dbTalk Databases Forums  

Calculated Cell - based on a condition of the same measure

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


Discuss Calculated Cell - based on a condition of the same measure in the microsoft.public.sqlserver.olap forum.



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

Default Calculated Cell - based on a condition of the same measure - 06-02-2004 , 09:34 AM






Some of the measures are reported as 0 in my database. But I want to
show NULL.
Here is the solution I found:

I created two base measures in my cube (based on exactly the same fact
table columns)

Sale0 : "Fact_Table"."Sale"
Sale : "Fact_Table"."Sale"

Sale 0 is a hidden measure.

Then I created a calculated cell:

Converting 0 to NULL
Calculation Subcube: {[Measures].[Sale]}
Calculation Value : iif([Measures].[Sale0] = 0,
NULL,[Measures].[Sale0])


Practically speaking, [Sale] is just a placeholder. But this seems
cumbersome. Is there a better way to do this? (Like not having to
create two measures instead of one). When I tried it... it was giving
me "infinite recursion" error. Maybe better MDX needs to be written.

In other words:
Converting 0 to NULL
Calculation Subcube: {[Measures].[Sale]}
Calculation Value : iif([Measures].[Sale] = 0,
NULL,[Measures].[Sale])

Now this would work if it were a calculated member. But I'd like to
use the calculated cell. (So that I can use nonemptycrossjoin on my
base measures)

I would appreciate your answer.

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.