cancel
Showing results for 
Search instead for 
Did you mean: 

IBP IF IS NULL Expression Not Responding

barnett
Discoverer
0 Kudos
860

Hi,

I am working on a requirement where i need create a new KF that will take the values of an existing KF and just simply replace the NULL periods with a 0. However, the new KF only displays the values from the original KF with all of the NULL periods still present. Below is my modeling

KF1 Is a Stored KF

KF1@REQUEST=SUM(KF1@DAYPRODLOCUOMTO)

KF1@DAYPRODLOCUOMTO = KF1@DAYPRODLOC * UOMCONVERSIONFACTOR@PRODUOMTO

KF2 is a Stored and calculated KF

KF2@REQUEST=SUM(KF2@DAYPRODLOCUOMTO)

KF2@DAYPRODLOCUOMTO = KF2@DAYPRODLOC * UOMCONVERSIONFACTOR@PRODUOMTO

KF2@DAYPRODLOC = IF(ISNULL(KF1@DAYPRODLOC),0,KF1@DAYPRODLOC) - Input from KF1 uses stored value

As you can see below, the NULL periods are not 0. I am confused on why this is?

What i was able to do is create a stand alone KF3 that does not reference KF1 or KF2 and apply an IFISNULL expression to it. Run a copy operator with KF1 as source and KF3 as target with generation of missing periods, then i get the NULL periods converted to 0's. It seems that only when the missing periods are generated that the IFISNULL expression is used.

I am not understanding why KF2 can not replace the NULL periods of KF1 with a 0 with my above modeling.

Accepted Solutions (1)

Accepted Solutions (1)

chris_topf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Daniel,

what is likely happening is that the periods where KF1 and KF2 appear to be null, are actually missing for KF1. You basically prove that by what the copy operator can do. A missing time period is not the same as a null time period, and the ISNULL comparison only works against a null or non-null value.

You could try writing the KF2 calculation as the following, using JF function instead, which defaults to the 'else' condition:

KF2@DAYPRODLOC = JF(NOT(ISNULL(KF1@DAYPRODLOC)),KF1@DAYPRODLOC,0) - Input from KF1 uses stored value.

You can see the difference between JF and IF on the Help portal here.

Regards,
Chris

barnett
Discoverer
0 Kudos

Thank you for the reply Chris. The expression you gave did not work but i have educated myself on the difference's between missing time periods and null time periods. I will move forward with the generation of missing time periods through the copy operator and this will satisfy the requirement just fine.

Answers (0)