Create table/visualization with the calculation of (Qty_Today - Qty_Yesterday)

I have an index which documents contain a date field, a PackageName field (with keywords) and Quantity field. Here follows a doc sample:
"Quantity" : 1054,
"PackageName" : "PackageName1",
"Date" : "2019-09-04",

I have one document for each day, for each PackageName. I need to create a table (or any visualization) in Kibana that present me, for each package name, de difference of the quantity at days Yesterday and Today.

This looks very simple, but unfortunately I was not able to create any visualization or table for that.

I plotted in the attached image that table that I'd like to create.
Could anyone help me?



Hmm, there's sort of a way to accomplish what you want.

  1. Create a data table visualization.
  2. Under Metrics, Choose your metric you want to display in the chart.
  3. Choose another metric, the "derivative", making sure to select the same custom metric you selected in (2).
  4. Under Aggregations, split rows by terms for package name.
  5. Under Aggregations, split table (rows) by data histogram with an interval of "daily".

The end result will end up looking something like this:

Where the table on the left is yesterday and the table on the right is today.

1 Like

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