Kibana Visual builder Math expression error

I am creating a line visualisation using Kibana Visual builder.
I defined two SUM aggregations on fields ingestedsize and primarystore.
Based on these two values I want to display % line.
For this I used Math aggregation, and defined two variables as show in below figure and used the expression to calculate the percentage.
But I am getting error "cannot divide by zero".

If I understand correctly, for any bucket, if the ps1 is zero we are getting the error. Is there any way to check if it is grater than 0 in expression.
Hope I am able to explain the problem, if you need any further details please let me know.

Hey @ravitandur, which version of Kibana are you using? I'm unable to replicate the "cannot divide by zero" issue in Kibana 7.2.0.

We are using elastic 6.6.1.
while you are testing, in any bucket, is denominator value was zero?
In my case, in some if the buckets we can except zero value as a output of aggregation we are using in calculation.

Hey @ravitandur would you mind creating a bug for this? It looks like even in Kibana 7.2 if you divide by zero there is an issue, just instead of displaying the "cannot divide by 0" error we're now displaying "No data to display for the selected metrics" .

In the mean-time, you could potentially use the clamp function to prevent this from being zero.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.