on 2023 Oct 26 6:49 PM
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.
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
10 | |
5 | |
4 | |
4 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.