Anyone Have Sales Gross Margin Dashboard?

This may be a question that needs a new post, but I am trying to dig into this report (Sales Gross Margin) a little more. I have a question about when to use OurShipQty v.s. SellingShipQty to calculate total cost.

If OurShipQty <> SellingShipQty then which one do you use to calculate total cost. You multiply each unit cost by total qty shipped to get total cost, but again, which one do you use. In @Vinaykamboj 's query, “ourshipqty” is always used, but I have seen the SGM report use a different field to calculate the totals. In fact there is one on our report where the selling ship qty is 2.5 and our ship qty is 5. In @Vinaykamboj query the margin is lower because it uses 5, but on the SGM report it uses 2.5.

Can anyone explain or teach the logic to me about what qty field to use when calculating total cost?

Part of me thinks it is whatever the tran qty is in the PartTran table, but I really would like to avoid joining to that table.

Furthermore, The zHompage_SalesGrossMargin that @hkeric.wci posted (I know it is a system query) uses the selling ship qty to calculate total costs. When the selling ship qty is 1 but the our qty is something else (i.e. the sales UM is 50x the IUM), then the margin is way higher than it should be.

It is all confusing me…

Looking forward to any replies or clarity.