Kibana - calculation in table

Hello,
There is a way to do calculations with the results presented in table visualizations? Not with scripted field, but with the values that are displayed in the table.

Thank you,
Francisca

Hi, there are many aggregations in Elasticsearch, many of them can group data up by something calculated. Almost everything in Kibana will use an Elasticsearch query feature to calculate something based on your documents.

Can you help us understand what you're trying to do? What kind of data, what are you trying to get the table to look like?

Hello,
Here it is the example that I want to make:


I want to calculate the x1/x2 of the values presented in the table and not the values line by line, because the results will be different. If I calculate line by line, I will need to do here a average of those values, which will result in different calculated values. Is there a way to do it?

Thank you,
Francisca

It might work to try this in Canvas. I'm not sure how you would get your data as those first 2 columns in Canvas. Maybe ES-SQL would work, or if you want to try your hand at programming, you could make a custom Canvas function that calls ES to run the "unique count per year" aggregation, and return the data table.

Then you can use mapColumn to get the calculated results

See:

Thank you, but I want to add to a dashboard, with Canvas that is not possible. Any other solution? I tried to use the Advanced > JSON Input, however this options it is not very flexible to add queries to data, to calculate the desired metrics.

2 Likes

Thank you! I will try!

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