dbTalk Databases Forums  

Cumulative Sums for %

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Cumulative Sums for % in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Yang Brito
 
Posts: n/a

Default 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?


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Cumulative Sums for % - 07-06-2004 , 12:04 AM






Exp() and Log() functions are available in the VBA library,
so you should be able to use them similarly to SQL.


- Deepak

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.