dbTalk Databases Forums  

Novice MDX Question about Calculated Members...

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


Discuss Novice MDX Question about Calculated Members... in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ron.brooks@csgpro.com
 
Posts: n/a

Default Novice MDX Question about Calculated Members... - 08-18-2005 , 04:31 PM






I have a measure, "Sales", and two dimensions, "Time" & "Customer". I
would like to create a calculated member called "Existing Customers",
and include all customers in the calculated member who have sales > 0
in [Time].[2003] or [Time].[2004].

I've been struggling with the MDX for this, and would appreciate some
insight on this issue. Thanks.


Reply With Quote
  #2  
Old   
Jim_OLAP
 
Posts: n/a

Default RE: Novice MDX Question about Calculated Members... - 08-19-2005 , 02:50 PM






Ron,

Try something like this -

--This will get a set of customers that have sales in 2004 ans 2005

With

set [CustomerswithSales] as 'filter(descendants([All Customer],0, self),
([2004], [Sales])>0 and ([2005], [Sales])>0)'

-- Use this calculated member to sum (or average) those Customers as a set

member [Customer].[CustSales] as 'sum([CustomerwithSales])', solve_order=1

HTH,

Jim


"ron.brooks (AT) csgpro (DOT) com" wrote:

Quote:
I have a measure, "Sales", and two dimensions, "Time" & "Customer". I
would like to create a calculated member called "Existing Customers",
and include all customers in the calculated member who have sales > 0
in [Time].[2003] or [Time].[2004].

I've been struggling with the MDX for this, and would appreciate some
insight on this issue. 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 - 2012, Jelsoft Enterprises Ltd.