cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Null values handling using LINK function in data actions in SAP SAC

azm_azm
Participant
0 Kudos
553

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.

azm_azm_0-1721123250286.png

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.

Accepted Solutions (1)

Accepted Solutions (1)

N1kh1l
Active Contributor

@azm_azm 

Try changing

IF LINK(Units(model A) !=NULL AND LINK(Units(model A) !=0 then

 

 

Hope this helps !!

Nikhil

 

END IF

Answers (1)

Answers (1)

William_Yu1
Product and Topic Expert
Product and Topic Expert

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: 

https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/00f68c2e08b941f081002fd3691d86a7/fa558b0ff273475c8f3cf...

Best regards, William