dbTalk Databases Forums  

Consolidate set members

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


Discuss Consolidate set members in the microsoft.public.sqlserver.olap forum.



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

Default Consolidate set members - 05-05-2005 , 10:38 AM






Hello,

I am a first-time poster and new to MDX, thanks in advance for your
help.

I am using FoodMart 2000 Sales cube to try to create a level above
Product Family. That is, I would like to create a level called
"Consumable" that contains "Drink" and "Food" but not "Non-COnsumable."
I have used Except which returns the correct members but is it
possible to return one row called "Consumable" rather than two rows
("Food" and "Drink")?

Except
({[Product].[Product Family].members}
,{[Product].[Product Family].&[Non-Consumable]}
)

I assume a Named Set is the correct implementation, correct? Is there
a function to consolidate set members into a single level/member? Is
that the correct MDX terminology?

Regards,
Sean


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

Default Re: Consolidate set members - 05-05-2005 , 06:21 PM






The typical way to do this with Analysis Services 200 is to define an
Aggregate() calculated member over the selected subset. Such a member
may have some limitations (in AS 2000), like not working with Distinct
Count measures:

Quote:
With Member [Product].[Consumable] as
'Aggregate(Except([Product].[Product Family].members,
{[Product].[Product Family].&[Non-Consumable]}))'

Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.