Home / Blog / Sales Purchase Database Analysis for Margin by Product and Customer
Sales Purchase Database Analysis for Margin by Product and Customer
Sales purchase database analysis for margin: link purchase cost to sales value by product, find thin lines and costly customers, and act on the results.
What you can request
Tell us your target and we prepare a sample.
Sales purchase database analysis for margin means joining your purchase records, which show what each product cost, with your sales records, which show what it sold for, so you can see the real margin on every product group, every customer and even every supplier. Many small and mid-sized businesses know their overall gross margin from the annual accounts but have no idea which lines and accounts produce it. Some products quietly lose money once freight and discounts are counted; some customers buy only the thinnest lines at the deepest discounts. This guide explains how to run a sales purchase database analysis for margin using your own books, and how to turn the results into pricing, buying and account decisions.
GST sales data refers to the outward supply records each registered business reports through GSTR-1 and GSTR-3B. Your sales register and your purchase register, matched each month with your return and your purchase statement, give clean taxable values on both sides, excluding tax. Those clean values are the right base for margin analysis, because GST collected and input credit claimed pass through the business rather than adding to or reducing profit, as long as credit is eligible and claimed.
Why Margin Analysis Needs Both Sides
Sales reports show revenue by product and customer. Purchase reports show cost by supplier and item. Margin lives where the two meet. Without linking them, a business sees that a product sells well but not that its cost has risen faster than its price, or that a large customer buys mainly the lines with the smallest margin.
Taxable Values, Not Totals
Always work with taxable values on both sides. Including GST in sales or purchase figures distorts margin, because tax is collected and credited rather than earned or spent. Where credit on a purchase is blocked, the tax becomes part of the cost and should be added to it.
Preparing the Data
Start with a product master that gives every item a code and a product group. Make sure both sales and purchase entries carry the same product codes. For traders, this is straightforward, because the same item is bought and sold. For manufacturers, link raw material purchases to finished products through a simple recipe or standard cost per unit.
Export a year of sales lines with date, customer, product code, quantity and taxable value, and a year of purchase lines with date, supplier, product code, quantity and taxable value. Add freight inward, packing and other direct costs, allocated to product groups by a simple rule such as share of purchase value.
Calculating Unit Cost
For each product, calculate a unit cost for each month or quarter: total purchase value plus allocated direct costs, divided by quantity bought. A weighted average over a quarter smooths out single expensive or cheap batches.
Handling Stock Movements
Goods bought in one month may be sold in another. For a simple analysis, apply the average unit cost of the quarter to all units sold in that quarter. Your accountant can refine this later with your stock valuation method.
Margin by Product Group
Multiply units sold by unit cost to get cost of sales for each product, then subtract it from sales value to get gross margin. Group products and calculate margin as a share of sales for each group.
Sort the groups by margin share and by total margin earned. The two rankings usually differ. A group with a high margin share but small volume may deserve more promotion. A group with large volume but a thin margin share may need a price review, a cheaper source or a decision to sell it only alongside better lines.
Watching Cost Trends
Plot unit cost and average selling price for the largest products by quarter. If cost rises while price stays flat, margin is being squeezed. Catching this early lets you raise prices or renegotiate with suppliers before the squeeze shows up in the annual accounts.
Margin by Customer
Apply the same unit costs to each customer’s purchases from you. Subtract from their sales value, and also subtract any discounts, rebates and credit notes given to them, to get margin per customer.
Customers often fall into a few groups. Some buy a balanced mix at fair prices and are highly profitable. Some buy large volumes but only of the thinnest lines, often at negotiated discounts. Some buy small amounts at full price and are profitable but slow to grow. Knowing which group each large customer falls into changes how you manage the account.
Cost to Serve
Some customers cost more to serve than others: frequent small deliveries, long credit, many returns. Where you can, add a rough cost to serve, such as delivery cost and the cost of extra credit days, to see margin after service. A customer that looks profitable on gross margin may not be after these costs.
Margin by Supplier
Link each product’s margin back to its main supplier. Where the same product is bought from several suppliers, compare unit costs, including freight and any rejected goods. The lowest invoice price does not always give the lowest landed cost.
Quality and Reliability Costs
Landed cost should also reflect what happens after delivery. A supplier whose goods are often rejected, short-shipped or delivered late adds hidden costs: time spent on returns, lost sales while waiting for replacements and extra stock held as a buffer. Note rejections and delays against each supplier in the purchase register, and add a simple charge for them when comparing sources. A slightly dearer supplier with reliable quality often gives better margin once these costs are counted.
| View | Built from | Decision it supports |
|---|---|---|
| Product group margin | Sales lines and unit costs | Pricing, promotion, range |
| Cost and price trend | Quarterly unit cost and price | Timing of price changes |
| Customer margin | Customer sales less cost and discounts | Account terms and focus |
| Supplier landed cost | Purchase lines with freight and rejections | Sourcing choices |
Turning Sales Purchase Database Analysis Into Action
The analysis matters only if it leads to change. For thin-margin products, test a modest price rise on a few customers, look for a cheaper supplier or bundle the line with stronger products. For thin-margin customers, review discounts and rebates at the next negotiation, and offer better terms tied to a richer product mix. For suppliers with high landed cost, share the comparison and ask for better terms, or move volume.
Write each action down with an owner and a review date. Rerun the analysis each quarter to see whether margins moved.
Setting Margin Floors
Agree a minimum margin for each product group, below which discounts need approval from the owner or sales head. Build the floors from the analysis rather than from guesswork, and review them each quarter as costs change. Floors give salespeople clear room to negotiate while protecting the business from deals that look large but earn little. They also make discount conversations easier, because the salesperson can point to a rule rather than a personal decision.
Sharing Results With the Sales Team
Salespeople often negotiate discounts without seeing margin. Share a simple view of product group margins and the margin of their main customers. When they understand which lines earn money, they steer conversations toward them and give discounts more carefully.
A Worked Example From a Hardware Wholesaler
A hardware wholesaler in Ludhiana had healthy sales growth but flat profit. Its accountant built a margin analysis from a year of sales and purchase lines, with freight allocated by purchase value.
The analysis showed that fasteners, one of the largest groups by volume, had a much thinner margin than the owner believed, because supplier prices had risen over the year while selling prices had not. It also showed that two large contractors bought almost only fasteners at deep discounts. The owner raised fastener prices modestly, negotiated with a second supplier and offered the contractors better terms on tools and fittings, which carried stronger margins. Over the next two quarters, gross margin improved while sales held steady.
Mistakes to Avoid in Margin Work
Using invoice totals including tax. Ignoring freight and other direct costs. Applying one year-old unit cost to the whole year. Looking at margin share without total margin. Treating every large customer as profitable. Producing the analysis without sharing it with the people who set prices and discounts. Each mistake is avoided by using taxable values, allocating direct costs and reviewing results quarterly with the team.
Guides for Analysis
Working capital from both sides is covered in sales purchase data analysis for working capital, and reading sales trends in how to look at sales data. A searchable archive of both sides is described in sales purchase database download into a local archive, and analytical solutions in sales data for analysis solutions. A director’s dashboard is in sales data of company performance.
Frequently Asked Questions
What is sales purchase database analysis for margin?
Linking purchase costs to sales values in your own records to see gross margin by product, customer and supplier.
Should GST be included in the figures?
No. Use taxable values, adding tax to cost only where credit is blocked.
How do I handle freight and packing?
Allocate them to product groups by a simple rule, such as share of purchase value, and include them in unit cost.
How often should the analysis be run?
Quarterly, with the largest products and customers checked monthly if margins are under pressure.
Run Your First Margin View This Quarter
Export a year of sales and purchase lines, calculate unit costs by quarter and build the product group view. When margins show which customers you want more of, request a sample list of similar businesses.
From requirement to data in four steps
A simple process with a sample before any purchase.
Share your target
Location, industry and campaign goal.
Review a sample
Check format, fields and relevance.
Confirm the pack
Finalise scope and volume.
Start outreach
Import the file and begin follow-up.
More guides on GST data
Compliant B2B Outreach Stack
Build a compliant B2B outreach stack in India: data sourcing, verification, DND scrubbing, email setup, CRM consent records, opt-outs and governance.
5 Best Ways to Get the GSTN Customer Support Number
Get the genuine GSTN customer support number through GST records, grievance facility, tax office, your CA or trade bodies, and avoid fake…
Sales Purchase Database
Sales purchase database basics for new bookkeepers: how to tell a sales bill from a purchase bill and which GST return each…
Related data categories
Request a Free Sample
Share your target location, industry and campaign goal. Review sample records before choosing the final pack.
