mikelblanco
IS-IT--Management
Hi
I have a calculation problem in my cubes:
My goal is to calculate the cost of each individual sale by multiplying the quantity times the cost, and then to have the sum of these individual calculations to have a sum of all costs.
This is the setting:
I have a virtual cube (V) taking two different measures (Unitarycost and Quantity) from two different cubes (Custinvoicetrans and Inventtable). I have a calculated member called TotalCost which multiplies Quantity times Unitarycost for each article sold. I use dimensions Date and ArticleNumber to look at the data.
For example, I sort by article # 321 and date 6th of May: It says 2 units were sold and the UnitaryCost is $5. The calculated member multiplies Quantity times Unitarycost (5$) and therefore Totalcost is 10$. All that is correct if you look each article line by line. The problem is that when looking at totals (not sorting neither by date nor article), the calculated member Totalcost multiplies the aggregated cost measure (the sum of all present cost figures) times the aggregated Unit measure (the sum of all units).
This is not correct because to get this numbers what its doing is just multiplying the aggregated Quantity times the aggregated cost.
To get a real aggregated total for the costs it should just sum each Totalcost calculation. How can I do this?
I have a calculation problem in my cubes:
My goal is to calculate the cost of each individual sale by multiplying the quantity times the cost, and then to have the sum of these individual calculations to have a sum of all costs.
This is the setting:
I have a virtual cube (V) taking two different measures (Unitarycost and Quantity) from two different cubes (Custinvoicetrans and Inventtable). I have a calculated member called TotalCost which multiplies Quantity times Unitarycost for each article sold. I use dimensions Date and ArticleNumber to look at the data.
For example, I sort by article # 321 and date 6th of May: It says 2 units were sold and the UnitaryCost is $5. The calculated member multiplies Quantity times Unitarycost (5$) and therefore Totalcost is 10$. All that is correct if you look each article line by line. The problem is that when looking at totals (not sorting neither by date nor article), the calculated member Totalcost multiplies the aggregated cost measure (the sum of all present cost figures) times the aggregated Unit measure (the sum of all units).
This is not correct because to get this numbers what its doing is just multiplying the aggregated Quantity times the aggregated cost.
To get a real aggregated total for the costs it should just sum each Totalcost calculation. How can I do this?