dbTalk Databases Forums  

calculate differences

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


Discuss calculate differences in the microsoft.public.sqlserver.olap forum.



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

Default calculate differences - 05-06-2004 , 01:26 PM






BUDGE
04/2003 04/2004 Diff --> calculated membe
acct1 ... ... ..
acct2 ... ... ..

Budget is a member of Measures dimension. 04/2003 and 04/2004 are members of Time dimension. acct1 and acct2 are members of Accounts dimension

Diff is the difference between 04/04 and 04/03. I need to have these 3 numbers at the same time. I used ParallelPeriod funcation to get Diff. But the problem is that I have to set the time dimension to be at 2004 --> 04 then I would lose the number for 04/2003. All numbers displayed as $0 for 04/2003

Any suggestions? Can this be done


Reply With Quote
  #2  
Old   
Michael Vardinghus
 
Posts: n/a

Default Re: calculate differences - 05-06-2004 , 02:08 PM






There are different ways to solve it out there.....one is to make a periodic
dimension (a calcualted member containg formulas in a dimension) - another
one is to make specific calculated members for the period's you want listed
in the report.

AS wise the first approach seems more elegant....the second approach gives
you more control over what to show (in my opinion....).

The quickest way for you was to use to last approach...(because for that I
can give you the formulas - you have to put these in the cube as calculated
members):

Calc1 = This year to date (the date chosen in time dimension) =
sum(ytd(),([Measures].[Budget Amount])
Calc 2 = Previous year to date (the date chosen in time dimension) =
sum(ytd(parallelperiod(Tid.[År], 1, Tid.currentmember)),
[Measures].[Amount])
Calc 3 = Calc 1 - Calc 2

....and here is one that can give you the total budget-amount regardless of
choice in the time dimension:

CALC4 = iif([Tid].currentmember.level is [År],[Measures].[Budget
Amount],ancestor([Tid].currentmember, [Tid].[År]))

\Michael Vardinghus

"christy" <anonymous (AT) discussions (DOT) microsoft.com> skrev i en meddelelse
news:123D059D-B155-4576-B01A-D923011AC870 (AT) microsoft (DOT) com...
Quote:
BUDGET
04/2003 04/2004 Diff --> calculated member
acct1 ... ... ...
acct2 ... ... ...

Budget is a member of Measures dimension. 04/2003 and 04/2004 are members
of Time dimension. acct1 and acct2 are members of Accounts dimension.

Diff is the difference between 04/04 and 04/03. I need to have these 3
numbers at the same time. I used ParallelPeriod funcation to get Diff. But
the problem is that I have to set the time dimension to be at 2004 --> 04
then I would lose the number for 04/2003. All numbers displayed as $0 for
04/2003.
Quote:
Any suggestions? Can this be done?




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.