Get Free Trial

Calculated Values shows Infinity when they should not

Answered
Henry asked on July 14, 2021

Hello,
 
We noticed that when we have two calculated values, one depending on the other to avoid division by 0, the dependent calculation shows Infinity when it should not. We have prepared a jsFiddle for ease of replication.

  • jsFiddle
  • In the provided example, we have defined two calculations
    1. Independent which is defined as the following calculation:
      if(sum(\"Price\") = 0, 0, sum(\"Quantity\") / sum(\"Price\"))
    2. Dependent which is defined as the following calculation:
      if(\"Independent\" = 0, 0, 1 / \"Independent\" )
  • We have also shown the Price and Quantity as columns to verify the calculations
  • For each row, we can see that each Dependent value is Infinity despite the calculation of Independent not working out to be 0. However,
    • If we add Independent as a column such that i appears before the Dependent column, we can see that the Dependent values are updated to their correct values
    • If we add Independent as a column such that it appears after the Dependent column, we can see that the Dependent values are still Infinity

 
Please let us know if there is something wrong with the jsFiddle or if we can provide any additional information!
 
Kind regards,
Henry

1 answer

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 15, 2021


Hello, Henry,
 
Thank you for reporting the issue.
 
It seems this behavior is only reproducible when using the custom data source API. It is due to some particular properties of the protocol.
We will research possible solutions for this issue and provide you with results ETA Aug 10.
 
Please let us know if other questions arise.
 
Kind regards,
Illia

Please login or Register to Submit Answer