Dividing Value of Chart

Hi,

I am new to Kibana and wanted your views on a simple query.
I am trying to create Horizontal chart, where I would like to divide the count of one field by 3 while displaying it as a chart.
Can you please help me to understand how can I achieve it?

Thanks
Abhishek

Moved to #kibana

Hi Abhishek,

unfortunately you currently cannot divide the output of an aggregation.

If you actually are not drawing a "Count" aggregation, but e.g. an average, you could create a scripted field in the management section, that has the value of your desired field divided by 3 in it. If you now use this scripted field to calculate average or sum or etc. it will calculate against all values divided by 3, which will have the same effect. But if you are looking into dividing the actual "count" of documents by 3, that's not working in classical visualizations.

This can work in timelion (but that would require you want to draw data over time), by calling .divide(3) on your data function (Timelion Tutorial).

Cheers,
Tim

1 Like

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