Kibana data tables

(Ambarish) #1

I am new to Kibana and am stuck with aggregating data in data tables.


I have imported sales data per region into elastic search for 2 weeks (one document per day) and here is a sample JSON.

{"type":"online","date":"05/01/2019","state":"WA", "orders":"1000","age_range":"18-24","device":"IOS"}
{"type":"online","date":"05/02/2019","state":"WA", "orders":"1000","age_range":"18-24","device":"IOS"}

I am trying to build this data table view:

STATE This-week Last-week Change
WA 1000 1100 10%
CA 1000 1300 30%

I am not sure how to aggregate current week and previous week data and compute the percentage change.