Hi All,
I would like to calculate, fastest growing company(each document is a company) in Germany for the year 2016 with the below formula,
(New value - original value)*100/original value
I have below structure in my ES index,
{ "allData": [{ "currency": [{ "pAndL": { "netSales": 59955 } }], "stmtDate": "2015-03-31", "isLatest": true }, { "currency": [{ "pAndL": { "netSales": 63134 } }], "stmtDate": "2014-03-31" } ] }
From the above structure New value will be netSales where isLatest is true and original value will be netSales from other object.
Along with the above two object sometimes I may contain more than two objects.
Could someone please help me on writing Elasticsearch query for fulfilling this requirement.
Thanks,
Ram