2024 Jul 16 10:58 AM - edited 2024 Jul 16 11:00 AM
Hi,
I'm facing the issue with Null values while writing the logic in data actions. Here is the scenario. I have two Models. Model A, has units and sales as account. Model B, has additional sales and commission % as account. The data is written in Model B by reading the values from Model A and writing an additional calculation.
Calculation:
IF Units = 0 or NULL then
Total Sales(model B) = Sales(model A) * Commission % (model B)
Else
Total Sales(model B) = Sales(model A) + Additional Sales(model B)
Please refer below screenshot.
I'm writing the same logic but no result is generated for Sept and Oct as they have null values. This is what I'm writing this code in data action. I'm using the correct syntax for LINK,DATA and RESULTLOOKUP statement in the below code and this pseudo code is for reference.
IF LINK(Units(model A) > 0 then
DATA(Total Sales(model B)) = RESULTLOOKUP(Sales(model A)) + RESULTLOOKUP(Additional Sales(model B))
Else
DATA(Total Sales(model B)) = RESULTLOOKUP(Sales(model A) ) * RESULTLOOKUP(Commission % (model B))
Anyone who has faced this similar kind of issue or knows the workaround in this case. Their comments would be deeply appreciated.
Thanks.
Request clarification before answering.
Try changing
IF LINK(Units(model A) !=NULL AND LINK(Units(model A) !=0 then
Hope this helps !!
Nikhil
END IF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi azm_azm,
Maybe you can try to have an additional IFELSE clause to explicitly check = Null .
In addition, also would recommend you to see if you can avoid null check according the best practice mentioned here:
Best regards, William
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
41 | |
15 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.