How to set the default value when calculated value is infinity or vividebyzero

Closed
leijing asked on March 26, 2024

When I use a calculated field, I generate infinity or divideByZero, and I want these values to appear as empty strings or other characters when they are generated.
I have set these two options through infinityValue: ", divideByZeroValue:" in formats, but so far it seems to be invalid

Attachments:
11111.png

5 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster March 26, 2024

Hello,

Thank you for reaching out to us.

To display infinity values as an empty string, we recommend setting the infinityValue and divideByZeroValue properties of the Format object:

formats: [{
   name: "infinity",
   infinityValue: "",
   divideByZeroValue: ""
}]

Then, you can set this format for the specific measure:

measures: [
..., // other measures
   {
     uniqueName: "Formula #1",
     formula: "sum(\"Price\") /0",
     caption: "Infinity",
     format: "infinity"
},
]

You are welcome to check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/yfqugta1/ 

Please let us know if it works for you. Looking forward to hearing from you.

Kind regards,
Nadia

Public
leijing March 27, 2024

Thank you for your reply. I will return the result to you after verification as soon as possible.
 
Best wishes,
leijing

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster March 27, 2024

Hello,

Thank you for the response.

Your feedback is valuable to our team. We are looking forward to hearing from you.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster April 17, 2024

Hello leijing,
Hope you are doing well.
We were wondering if you had a chance to check the suggested approach. Could you please confirm if it works for you?
Looking forward to hearing your feedback.
Kind regards,
Nadia

Public
leijing April 17, 2024

Hello Nadia,
Thank you for your help and your reply has solved the problems I encountered.
 
Best wishes,
leijing

This question is now closed