Support for scripted metrics in data tables and visualisations

We're trying to achieve a data table with the following headers, created from aggregations of our sold items:

Brand , Qty sold, Total revenue, Total cost, Total profit, Margin (%)

I've realized that the final column is not possible due to the fact that Kibana doesn't support bucket script aggregations.

Investigating this on Google I found many people requesting this and several open and closed GitHub issues. It's also been suggested to use TimeLion which while being able to do this calculation is unusable as part of a data table. In our case, some simple excel-like functionality such as the possibility to render a column in this data table whose value is equal to column 5 as a percentage of column 4 - would also allow us to achieve the above.

Is there any timeline to implement this? The lack of this feature places serious limitations on Kibana as it makes impossible many common use cases.

Hi Mike,

everything you found out so far is absolutely correct. We don't have any timeline on implementing bucket script aggregations in the classical visualization editor (the first ticket you found).

Nevertheless the Visual Builder has support for Bucket Aggregations, and will introduce a new Tabel visualization with 6.1. You should be able to achieve the wished result with that visualization once it's released.


Hi Tim,

Thanks for your reply. The new time series visualization builder looks good, though this forces us to work with time series which might not be desired in many cases. It seems like this would be a natural/expected feature of classic visualizations too.

Quoted from the PR by its author @simianhacker:

@shaharmor I think you should make a feature request issue for adding calculation to core Kibana's data table visualization. Since that one doesn't have a date_histogram by default and will do everything you want with the exception of the calculation.

Yeah, for that implementation you should follow #4707, but there is no timeline yet for this.

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