dbTalk Databases Forums  

How to treat Negative number as NULL?? Expert help please!!

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


Discuss How to treat Negative number as NULL?? Expert help please!! in the microsoft.public.sqlserver.olap forum.



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

Default How to treat Negative number as NULL?? Expert help please!! - 02-17-2005 , 06:46 PM






I am using OLAP analysis services,

As part of the calculated members formula, I got a few cells with
negative numbers. And I would like to treat them as Zero or NULL if
the calculation turns out to be a negative number.

Is there a function I can do that??? IIF? or something else?

Please let me know as soon as possible!!
thanks
jon


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

Default Re: How to treat Negative number as NULL?? Expert help please!! - 02-17-2005 , 08:24 PM






the easy way:
create a new measure based on your table column and setup an SQL formula
like:
(SQL server syntax)
case when MyColumn <=0 then Null else MyColumn end

negative values become null values and these values are not aggregated by
analysis services.

"JJ SF" <datacentric (AT) gmail (DOT) com> wrote

Quote:
I am using OLAP analysis services,

As part of the calculated members formula, I got a few cells with
negative numbers. And I would like to treat them as Zero or NULL if
the calculation turns out to be a negative number.

Is there a function I can do that??? IIF? or something else?

Please let me know as soon as possible!!
thanks
jon




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.