Flexmonster 2.9 calculated value issue

Answered
mstrukov asked on June 7, 2021

Hi All,
 
We are trying to migrate to Flexmonster 2.9 and noticed an issue with a calculated value.
Steps to reproduce (see attachment for visual representation):

  1. Go to your demo page. 
  2. Configure the report by putting Date.Day as rows and Date.Month as columns. Use Quantity as the only value. Click Apply.
  3. Examine the report. You should see empty cell for the intersection of January column and 8 row.
  4. Change the configuration of the report. Remove Quantity as a value and add a calculated one as Quantity / 10. Click Apply.
  5. Examine the report. 

 
Expected result:
The cell on the intersection of January and 8 is still empty.
Actual result:
The cell on the intersection of January and 8 is 0.
 
Why do we get 0 when we basically divide empty/null value by 10 ? 
Please note it works as expected for Version 2.310 (build 27/02/2017 14:26:19).
We believe we reported this bug many years ago. Some time in July 2012 according to our backlog.
 

1 answer

Public
Milena Pechura Milena Pechura Flexmonster June 8, 2021

Hello!
 
Thank you for writing to us.
 
As the expected result for the mentioned aggregation depends on the use-case, we provide an option to configure the described above behavior. 
Please use the calculateNaN property of the calculated value object:

"slice": {
"measures": [
{
"uniqueName": "Formula #1",
"formula": "sum(\"Quantity\") / 10",
"caption": "Formula #1",
"calculateNaN": false
}
],
...
}

Here is an example for illustration: https://jsfiddle.net/flexmonster/e9qfuz03/.
 
Hope our answer helped!
 
Best regards,
Milena

Please login or Register to Submit Answer