Custom Field Doesn't Show Percentage in Metric

I'm calculating a field against a known value. In this example I have a number of units that when calculated against 7500, it shows a value of 600%. When adding another 0 to make it 75,000 (the actual number i need to use) it doesn't give a value at all (it should be 60%). Additionally, I've changed the format default from Number to Percentage without any results.

Alternatively, I've also noticed that if you don't have a leading zero when multiplying, the script errors out. So, what I wonder is if Kibana is making the calculation, totaling my result with a decimal point but without a leading 0.

My Kibana metric field is selected via "max" aggregation and then the name of the field. No buckets are selected and under options. In addition, i've tried all variations under options to try to obtain a different result with not luck.

If anyone else has ran into this, i'd love to hear how you worked around it.

I was able to get my results by putting my equation in a parenthesis and then multiplying that result against 0.1, looking something like:

(doc['units'].value / 7500) * 0.1

Still, I shouldn't have to do that. Ideally i should be able to do this:

(doc['units'].value / 75000)

Hello,

This looks like a bug. Can you please log it here?

Thanks,
Bhavya

Will do. Thank you @bhavyarm

fwiw - I added this to the bug tracker: https://github.com/elastic/kibana/issues/31866

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