Search code examples
elasticsearchkibanaelastic-stackkibana-7

Kibana Visualize Data Table - Difference Between Aggregate Functions in a Separate Columns


Using Kibana 7.10.2 with the documents below, is there a way to compute a custom column that contains the difference between Min(value) and Max(value)?

{
  "_source": {
    "value": 10
  }
},
{
  "_source": {
    "value": 15
  }
}

Desired table structure

------------------
 Min | Max | Diff
------------------
  10 |  15 |  5
------------------

Min and Max are built-in functions under Metric Aggregations. Is there a way to create a difference between two aggregate functions in a separate column?


Solution

  • The solution is to use TSVB that allows mathematical functions based on tinymath. The downside is that currently exporting is not supported by TSVB.