% calculation doesn't seem correct

Hi Team,

I drew a Metric using TSVB by following the excellent article How to display data as a percentage in Kibana visualizations | Elastic Blog
So far so good.
But when I am calculating the % manually, its no where correct.

The query which I used:
For Numerator ->

eventName.keyword  :UPLOAD_STAGE  and payload.document.status.keyword:VALID_DOCUMENT  and payload.document.type.keyword:Passport

I received a count as 55 in discover tab

For Denominator->

eventName.keyword :RETRIEVAL_STAGE

I received a count as 926 in Discover tab

So if I calculate the percentage manually, it comes as 5.9

However Kibana is showing as 68%.

I am bit confused. Is there anything wrong with my approach?
Why am I having different percentage calculation result?
Looking forward to help me understand the mistakes.
Thank you!

Hi Vivek,
This isn't quite my area, but my understanding is that the most likely reason is your Data Timerange mode.
If you're using anything but the time series chart type, such as metric, you probably need to choose Entire Timerange.

@gmmorris : No worries. I have just found the solution.
Lower case "and" was creating the problem in Numerator and Denominator.

But I believe case shouldn't matter. Do you agree with me?
If yes, then we can ask for improvement.

1 Like

Hey @vivekshukla! Which version do you use? On 7.10 we changed the filter ratio to also support KQL in order to avoid this kind of confusion. Until then, it only supported Lucene. KQL support in filter ratio in TSVB · Issue #67503 · elastic/kibana · GitHub

@Stratoula_Kalafateli Yeah,I am using 7.4 and that might be the reason.

1 Like

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