Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NULL value treatment

Status
Not open for further replies.

apad

Programmer
Feb 21, 2005
6
FR
Hi

I get a fact table with 2 key fields (1 key for Time dimension and 1 key for Product dimension) and 3 numéric fields for measures (MeasureA, MeasureB, MeasureC)
Few records have the value NULL for the field MeasureC

I create a Calculated Member with this formula :
IIf(MeasureC is NULL, MeasureA x MeasureB, MeasureA x MeasureC)

I realise that NULL values was converted in 0, so expression "MeasureC is NULL" is ever FALSE. The result of this Member is MeasureA x MeasureC (=0 when MeasureC is NULL)

How can I treat the NULL value ?

Thanks

 
I found a "solution".

I created a Measure named MeasureCIsNull with the property
Code:
Source Column = 
CASE WHEN "dbo"."FAITS"."MEASUREC" IS NULL THEN 1 ELSE 0 END

I modified my Calculated Member like this :
Code:
Iif(MeasureCIsNull = 1, MeasureA x MeasureB, MeasureA x MeasureC).

I'm not proud but I didn't find better.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top