dbTalk Databases Forums  

calculated member returning non empty leaf level

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


Discuss calculated member returning non empty leaf level in the microsoft.public.sqlserver.olap forum.



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

Default calculated member returning non empty leaf level - 12-15-2004 , 06:33 PM






Hello,

Please help. Can someone please tell me how to return only the 'non empty'
results from the following query using the FoodMart 2000 Sales cube:

with member [Measures].[AltadenaUnitSales] as '([Measures].[Unit Sales],
[Customers].[State Province].&[CA].&[Altadena], [Promotions].[Promotion
Name].&[Best Savings])'
select
{[Measures].[AltadenaUnitSales], [Measures].[Unit Sales]} on columns,
NON EMPTY [Customers].[All Customers].[USA].[CA].Children on rows
from Sales
where ([Promotions].[All Promotions].[Best Savings])


If I exclude the calculated member called [Measures].[AltadenaUnitSales],
then my query does return only the 'non empty' results as in:
select
{[Measures].[Unit Sales]} on columns,
NON EMPTY [Customers].[All Customers].[USA].[CA].Children on rows
from Sales
where ([Promotions].[All Promotions].[Best Savings])


However, I really need the calculated member for other calculations I intend
to do. In this sample query, the fact that the mdx is returning every leaf
level of the Customers dimension is really impacting performance on my cube.

I really do appreciate your assistance.

Kind regards,

Jason


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

Default Re: calculated member returning non empty leaf level - 12-15-2004 , 07:54 PM






Will this tweak to [AltadenaUnitSales] work?

Quote:
with member [Measures].[AltadenaUnitSales] as
'iif(IsEmpty([Measures].[Unit Sales]), NULL,
([Measures].[Unit Sales],
[Customers].[State Province].&[CA].&[Altadena],
[Promotions].[Promotion Name].&[Best Savings]))'
select
{[Measures].[AltadenaUnitSales], [Measures].[Unit Sales]} on
columns,
NON EMPTY [Customers].[All Customers].[USA].[CA].Children on rows
from Sales
where ([Promotions].[All Promotions].[Best Savings])
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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.