Hey there,
we want to track the inventory of our products with Elasticsearch and Kibana. We are currently doing a prototype for that and are struggling with Kibana.
The situation:
We have different warehouses. Each product can have inventory in each warehouse.
We get new inventory data daily. These data are only of products where the inventory changed.
The inventory numbers are absolute. This means we get messages like "The inventory of product A is at 50 now" and not "The inventory of product A changed by -10".
For each new inventory message we have a new document. This is what a document looks like:
{
"sku": "super_shirt_XL_green",
"product": "super_shirt"
"skuInventoryDate": "2018-06-26T11:32:07",
"warehouse": "warehouse A",
"inventory": 15
}
{
"sku": "super_shirt_XL_red",
"product": "super_shirt"
"skuInventoryDate": "2018-06-26T05:35:04",
"warehouse": "warehouse B"
"inventory": 20
}
The problem:
If you want to get the newest inventory for every product, you can do that with Elasticsearch easily. Just do an aggregation that only selects the newest document for every SKU.
But how can you do that with Kibana? I could not find a way to e. g. sum up the newest inventory of every product in a warehouse to get a full inventory sum of all products for that warehouse.
I cannot believe this is not possible in Kibana, but neither could I find a way to solve this problem.