dbTalk Databases Forums  

NULL to 0 Conversion

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


Discuss NULL to 0 Conversion in the microsoft.public.sqlserver.olap forum.



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

Default NULL to 0 Conversion - 05-22-2006 , 06:24 PM






Is there any way to convert a NULL to a 0 in either an MDX calculated member
or otherwise without creating a value for members that would otherwise be
empty. I have several hundred employees, only a few of whom create revenue.
I don't want the others to show. There are however several consultants who
have NULL or 0 revenue. When I try to convert the NULL to a zero (using IIF
expression) I return all of the other employees as well. I'm trying to avoid
having to using Reporting Services expressions to convert NULL's to zeros and
manage less code.

Reply With Quote
  #2  
Old   
Jeje
 
Posts: n/a

Default Re: NULL to 0 Conversion - 05-22-2006 , 07:09 PM






when you create an MDX query, don't use the NON EMPTY command to exclude
empty cells.
like:
select dimension.hierarchy.members on columns from sales

instead-of :
select non empty dimension.hierarchy.members on columns from sales

the non empty keyword exclude empty members (members with null values)
the measure value still a null value. in this cASE, you have to convert null
to 0 if you want by creating a calculated measure and using the IIF syntax.

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

Quote:
Is there any way to convert a NULL to a 0 in either an MDX calculated
member
or otherwise without creating a value for members that would otherwise be
empty. I have several hundred employees, only a few of whom create
revenue.
I don't want the others to show. There are however several consultants
who
have NULL or 0 revenue. When I try to convert the NULL to a zero (using
IIF
expression) I return all of the other employees as well. I'm trying to
avoid
having to using Reporting Services expressions to convert NULL's to zeros
and
manage less code.



Reply With Quote
  #3  
Old   
Tim Dot NoSpam
 
Posts: n/a

Default Re: NULL to 0 Conversion - 05-22-2006 , 07:29 PM



Why don't you make this a business rule in the ETL? The only reason I bring
this up is because I have a similar problem and it unfortunately increases
the overall complexity of the cube to have to "fake" values.

-Tim

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

Quote:
Is there any way to convert a NULL to a 0 in either an MDX calculated
member
or otherwise without creating a value for members that would otherwise be
empty. I have several hundred employees, only a few of whom create
revenue.
I don't want the others to show. There are however several consultants
who
have NULL or 0 revenue. When I try to convert the NULL to a zero (using
IIF
expression) I return all of the other employees as well. I'm trying to
avoid
having to using Reporting Services expressions to convert NULL's to zeros
and
manage less code.



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.