Need a special offer?Find out if your project fits.
+

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

3 answers

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

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster August 11, 2021

Hello, Henry,
 
We are happy to let you know that the issue with dependent calculated values was fixed.
This is included in the 2.9.5 version of Flexmonster: https://www.flexmonster.com/release-notes/.
 
You are welcome to update the component.
Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
 
Please let us know if everything works fine for you.
 
Best regards,
Illia

Public
Henry August 11, 2021

Hello, Illia,
 
Upgrading to 2.9.5 looks to have fixed the issue. Thanks much to you and the team!
 
Kind regards,
Henry

Please login or Register to Submit Answer