dbTalk Databases Forums  

Calculated Members - Crossjoin?

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


Discuss Calculated Members - Crossjoin? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
neil@willowvale-nairn.co.uk
 
Posts: n/a

Default Calculated Members - Crossjoin? - 08-02-2012 , 07:02 AM






I am adding a calculated member to a cube where I want to aggregate differences between measures from a number of last periods against a measure for the current period:

Simplified I am using this:

SCOPE ([Measures].[Fact3]);
THIS =
Aggregate( LastPeriods(3,[Period].CurrentMember),
([Measures].[Fact1]-([Period].CurrentMember,[Measures].[Fact2]))
);

END SCOPE;

But this returns:

(Period1 Fact1 - Period1 Fact2) + (Period2 Fact1 - Period2 Fact2) + (Period3 Fact1 - Period3 Fact2)

But I want:

(Period1 Fact1 - Period3 Fact2) + (Period2 Fact1 - Period3 Fact2) + (Period3 Fact1 - Period3 Fact2)

Any help appreciated.

Thanks

Reply With Quote
  #2  
Old   
neil@willowvale-nairn.co.uk
 
Posts: n/a

Default Re: Calculated Members - Crossjoin? - 08-02-2012 , 07:12 AM






Just to add that I will be extending this to aggregate the Squares/cubes of the differences and other calulcation so it is not just a case of reordering the simple math to Sum(last periods, Fact1) - 3*(CurrentMember,Fact2)

Thanks

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 - 2013, Jelsoft Enterprises Ltd.