How do I analyse gross margin by product with iDBQuery?
Ask iDBQuery 'What is the gross margin of each product, and which lines are least profitable?' It joins revenue to cost of goods across your sales and cost tables, returns margin percentage and value per product as a chart, and cites each figure to its source rows.
Gross margin by product shows how much profit each item leaves after its direct cost, revealing which lines truly earn their place. iDBQuery calculates it even when revenue and cost live in different systems.
- You'd ask iDBQuery: 'Show gross margin percentage and gross profit by product for the last quarter, ranked worst to best, and total the low-margin lines.'
- It joins sales revenue to cost of goods per product, computes margin, and returns a ranked chart plus a table.
- Each figure is cited to its source rows, so 'this SKU's 12% margin' is backed by the actual sales and cost records.
The insight comes from follow-ups: 'Which of our top-selling products has the thinnest margin?' or 'Show margin after discounts and returns.' iDBQuery keeps the thread and refines the query. Because product cost often sits in an ERP and sales in a store or CRM database, the one live model joins them so margin reflects true cost, not a placeholder. You can define margin once in the semantic layer so every team's figure agrees. Save it as a live report for merchandising and finance, and let the Analyst agent surface products that sell well but contribute little profit, along with the rows that prove the case. This pairs naturally with pricing and discount analysis.
Updated 2026-06-22