Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, stalwar1johnwmarcowedelabhishekaggarwal
I have following two tables on Sales data. I have to calculate Sales measures like COGS, Sales_Amount, Margin_Amount. Please suggest what should be the calculations based on the fields given below.
SALES_ORDER_DETAIL:
SalesOrderID (pk)
SalesOrderDetailID
CarrierTrackingNumber
OrderQty
ProductID
SpecialOfferID
UnitPrice
UnitPriceDiscount
LineTotal (LineTotal = UnitPrice - (UnitPrice * UnitPriceDiscount))
SALES_ORDER_HEADER:
SalesOrderID (fk)
RevisionNumber
OrderDate
DueDate
ShipDate
Status
OnlineOrderFlag
SalesOrderNumber
PurchaseOrderNumber
AccountNumber
CustomerID
ContactID
SalesPersonID
TerritoryID
BillToAddressID
ShipToAddressID
ShipMethodID
CreditCardID
CreditCardApprovalCode
CurrencyRateID
SubTotal
TaxAmt
Freight
TotalDue (TotalDue = SubTotal + TaxAmt + Freight)
Please help. Thanks in advance.
Joy
Hi,
Could you elaborate?
You'd load the above tables and based on your needs, do a group by sum or min or max.
Hi,
Thanks for the reply. I know But my question was different. I want to know the formula to calculate the sales measures like COGS, Sales Amount, Sales Margin. I need the formula based on the fields mentioned.
Thanks,
Joy