Cumulative Sums for % -
07-02-2004
, 04:14 PM
Hello,
I need a measure that calculates wich supplliers got the highests increases (in %) over groups of products. I do not have the value, but just the % each supplier got over a group.
i.e: I need to sum the % and devide the sum by 3, for each Supplier below.
Supplier 1 Supplier 2
Group 1 10% 9%
Group 2 4% 5%
Group 3 5% 5%
The problem is that I cannot just sum the % (as 20% + 20% increase <> 40% increase).
If I wanted a simple cumulative sum over values I would have (by G. Spofford):
Sum (
Head (
Order (
{[ProductGroup].Parent}.Children},
[Measures].[Percent],
BDESC
) AS OrdSet,
Rank (
[ProductGroup],
OrdSet
)
),
[Measures].[Percent]
)
In SQL, I have something like that:
Select exp(Sum(log(1+((case when PercentValue = -100 Then -99.9999 else PercentValue end)/100))))-1)*100
.....
Group by ....
Order by ...
How can I do it with % im MDX? |