dbTalk Databases Forums  

Set Measure value = 0 if Dimension value is a specific value

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


Discuss Set Measure value = 0 if Dimension value is a specific value in the microsoft.public.sqlserver.olap forum.



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

Default Set Measure value = 0 if Dimension value is a specific value - 07-11-2005 , 11:09 PM






Dear all,

Any idea how to set the formula of a calculated member for if a dimension
value is equal to say 'N/A', then the calculated value is set to 0 ?
I tried the formula as below, although syntax is ok, but after the cube is
processed, the result is always error.
Any idea ?

Iif( [Census Gender].[Gender All].&[All Gender].&[N/A], 0,
[Measures].[Census Pop])


Thanks in advance.
Mag

Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: Set Measure value = 0 if Dimension value is a specific value - 07-11-2005 , 11:32 PM






try something like this:

Iif([Census Gender].CurrentMember is [Census Gender].[Gender All].&[All
Gender].&[N/A], 0,
[Measures].[Census Pop])

or
Iif([Census Gender].CurrentMember.UniqueName = [Census Gender].[Gender
All].&[All Gender].&[N/A].UniqueName , 0,
[Measures].[Census Pop])


"magwg" <magwg (AT) discussions (DOT) microsoft.com> wrote

Quote:
Dear all,

Any idea how to set the formula of a calculated member for if a dimension
value is equal to say 'N/A', then the calculated value is set to 0 ?
I tried the formula as below, although syntax is ok, but after the cube is
processed, the result is always error.
Any idea ?

Iif( [Census Gender].[Gender All].&[All Gender].&[N/A], 0,
[Measures].[Census Pop])


Thanks in advance.
Mag



Reply With Quote
  #3  
Old   
magwg
 
Posts: n/a

Default Re: Set Measure value = 0 if Dimension value is a specific value - 07-12-2005 , 02:48 AM



Jéjé,

Thanks a lot. I can have 0 value for N/A, however the rollup sum of the
calculated measure for dimension 'Gender' is still sum of all original values
of different gender including 'N/A', how can tackle this ? Please advise.



"Jéjé" wrote:

Quote:
try something like this:

Iif([Census Gender].CurrentMember is [Census Gender].[Gender All].&[All
Gender].&[N/A], 0,
[Measures].[Census Pop])

or
Iif([Census Gender].CurrentMember.UniqueName = [Census Gender].[Gender
All].&[All Gender].&[N/A].UniqueName , 0,
[Measures].[Census Pop])


"magwg" <magwg (AT) discussions (DOT) microsoft.com> wrote in message
news:3A604496-EC5C-40B7-ACF7-0A86A45C99AC (AT) microsoft (DOT) com...
Dear all,

Any idea how to set the formula of a calculated member for if a dimension
value is equal to say 'N/A', then the calculated value is set to 0 ?
I tried the formula as below, although syntax is ok, but after the cube is
processed, the result is always error.
Any idea ?

Iif( [Census Gender].[Gender All].&[All Gender].&[N/A], 0,
[Measures].[Census Pop])


Thanks in advance.
Mag




Reply With Quote
  #4  
Old   
Jéjé
 
Posts: n/a

Default Re: Set Measure value = 0 if Dimension value is a specific value - 07-12-2005 , 07:25 PM



the formula don't overide the sum applied at the "all gender" level.
this level still contin the sum of each gender including the "N/A" value


"magwg" <magwg (AT) discussions (DOT) microsoft.com> wrote

Quote:
Jéjé,

Thanks a lot. I can have 0 value for N/A, however the rollup sum of the
calculated measure for dimension 'Gender' is still sum of all original
values
of different gender including 'N/A', how can tackle this ? Please advise.



"Jéjé" wrote:

try something like this:

Iif([Census Gender].CurrentMember is [Census Gender].[Gender All].&[All
Gender].&[N/A], 0,
[Measures].[Census Pop])

or
Iif([Census Gender].CurrentMember.UniqueName = [Census Gender].[Gender
All].&[All Gender].&[N/A].UniqueName , 0,
[Measures].[Census Pop])


"magwg" <magwg (AT) discussions (DOT) microsoft.com> wrote in message
news:3A604496-EC5C-40B7-ACF7-0A86A45C99AC (AT) microsoft (DOT) com...
Dear all,

Any idea how to set the formula of a calculated member for if a
dimension
value is equal to say 'N/A', then the calculated value is set to 0 ?
I tried the formula as below, although syntax is ok, but after the cube
is
processed, the result is always error.
Any idea ?

Iif( [Census Gender].[Gender All].&[All Gender].&[N/A], 0,
[Measures].[Census Pop])


Thanks in advance.
Mag






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.