January 25, 2007 at 4:03 am
Hello,
Imagine i have a very simple cube with a fact table which the key is the product. I have two measure: MEASURE.PRICE, MEASURE.WEIGHT and some dimensions
If i create a calculated member
MEASURE.CALCUL = MEASURE.PRICE/MEASURE.WEIGHT
At any hierarchy of my cube i have
MEASURE.CALCUL = sum(MEASURE.PRICE)/ sum(MEASURE.WEIGHT) for the current set
Now immagine i want to calculate this ratio in the fact table to calculate MEASURE.PRICE/MEASURE.WEIGHT for each product and after calculate the average of the ratio.
How can i do that in MDX ?
I know it's more simple to do this in sql with a calculated column for exemple but i want to know how to do in mdx
Thanks a lot
January 29, 2007 at 8:00 am
This was removed by the editor as SPAM
January 31, 2007 at 1:18 am
Hi,
I think you do not need to do anything in MDX with your example.
Once you can calculate the first ratio on the lowest level of granularity, you only need to choose the correct aggregation function for your measure.
Change it from sum (default) to avg (don't remember what it is called in BIDS) and you're done.
But mind that it will compute something else than what you have in your iroginal MDX!
Michael
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply