cancel
Showing results for 
Search instead for 
Did you mean: 

Formula which includes null values

Former Member
0 Kudos

Hi,

I am struggling to create a formula which caters for null values.

My formula contains IF( ZTAG2 > 0, ZTAG2, ZTAG1 ), but ZTAG2 or ZTAG1 can be null which is causing the result to be null. I need the result to be 0.

Is there a way that I can default ZTAG2 and ZTAG1 to have a zero value? They are both set up as numeric key figures.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

define formula or ckf in which you use as

ckf ZTAG1 = ZTAG1 + 0.

ckf ZTAG2 = ZTAG2 + 0.

the ckf will have the same values ZTAG1 & ZTAG2 and all the places where they had null values the CKF's will show 0.

the CKF's will be global and can be used in any formula or restriction.

regards,

Arvind.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks Arvind, but I am using a forumla within a transformation. I don't think I can assign values like that?

rajkumar_kandula
Active Contributor
0 Kudos

Hi,

Try this

IF( ZTAG2 > 0, (ZTAG20), (ZTAG10) )

regards,

Raj

balajee_sivakumar
Contributor
0 Kudos

Hi,

I feel that instead of using "Formula", you can use "ABAP Routine" in your transformation, where in you can easily assign values to variables and compare whether the key figure values are "Zero" or not.

Regards,

Balajee