dbTalk Databases Forums  

MDX: Union of slices

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


Discuss MDX: Union of slices in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
yashgt@yahoo.com
 
Posts: n/a

Default MDX: Union of slices - 12-02-2004 , 08:10 AM






I would like to slice on 2 dimensions in the following way:
In the sales cube in the sample OLAP database I need to retrieve the
Unit Sales for Gender=Male OR Marital Status=Married. This mean I am
looking for the measure on the UNION.

Somebody suggested, I do this:
with member measures.mm as
'sum( union( { {gender.m} * [marital status].[marital status].members }
, { gender.gender.members * {[marital status].m}}) ,[unit sales])'
select
{ mm} on columns,
[store].[store name].members on rows
from Sales

This worked very well. But the problem is , I want to get other
measures, such as Cost, Sales, Max Sales, Profit, etc, for the same
union of slices. I also want to get all measures for Gender=Female OR
Status=Married.
Ideally, without adding an extra dimension table, and an extra join
clause to the cube, I would like to create a dimension based on the
existing dimensions. I am not very conversant with virtual dimensions.
Can someone guide me on exactly how to achieve the right effect?
Ideally I would like to have members MaleMarried, FemaleMarried,
MaleSingle and FemaleSingle. How should I write the MDX if I create
these as calculated members in the new virtual dimension?

Thanks,
Yash


Reply With Quote
  #2  
Old   
jam96-BuffaloJoe
 
Posts: n/a

Default RE: MDX: Union of slices - 12-02-2004 , 02:59 PM






I have used the CELL PROPERTIES, FORMATTED_VALUE, BACK_COLOR values for
things like this.
I use it for stop lighting functionality.

If you apply the value two as a cell property, will this help?


Joe

"yashgt (AT) yahoo (DOT) com" wrote:

Quote:
I would like to slice on 2 dimensions in the following way:
In the sales cube in the sample OLAP database I need to retrieve the
Unit Sales for Gender=Male OR Marital Status=Married. This mean I am
looking for the measure on the UNION.

Somebody suggested, I do this:
with member measures.mm as
'sum( union( { {gender.m} * [marital status].[marital status].members }
, { gender.gender.members * {[marital status].m}}) ,[unit sales])'
select
{ mm} on columns,
[store].[store name].members on rows
from Sales

This worked very well. But the problem is , I want to get other
measures, such as Cost, Sales, Max Sales, Profit, etc, for the same
union of slices. I also want to get all measures for Gender=Female OR
Status=Married.
Ideally, without adding an extra dimension table, and an extra join
clause to the cube, I would like to create a dimension based on the
existing dimensions. I am not very conversant with virtual dimensions.
Can someone guide me on exactly how to achieve the right effect?
Ideally I would like to have members MaleMarried, FemaleMarried,
MaleSingle and FemaleSingle. How should I write the MDX if I create
these as calculated members in the new virtual dimension?

Thanks,
Yash



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.