We have table with the data as shown below :
Region,State,Date,Metric,Amount R1,S1,Jan 01 2010, Sales,28223 R1,S1,Jan 01 2010, Qty, 230 R1,S2,Jan 01 2010, Sales,28223 R1,S2,Jan 01 2010, Qty, 230
We would like to have a third metric to be computed as a separate row. When the user tries to build a report at a Region Level , then it should aggregate the data and show all the 3 metrics ( 2 Available and 3rd computed)
3rd Metric formula - Price Per Qty: Value for Metric Sales/Value for Metric Qty.
We would like to see the data in the format below :
Region,State,Date,Metric,Amount R1,S1,Jan 01 2010, Sales,28223 R1,S1,Jan 01 2010, Qty, 230 R1,S1,Jan 01 2010, Price Per Qty, 28223/230 R1,S2,Jan 01 2010, Sales,3452 R1,S2,Jan 01 2010, Qty, 122 R1,S2,Jan 01 2010, Price Per Qty, 3452/122
Suppose the user tries to build a report at Region Level , then the report should be as shown below :
Region,Metric,Amount
R1,Sales,sum(28223+3452)
R1,Qty,sum(230+122)
R1,Price Per Qty , Sum(28223+3452)/sum(230+122)
Any help is highly appreciated.