Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

Divide multi series (month wise) data points of one field with total sum of another field for the selected duration #201

Open
evanceheallyg opened this issue Mar 28, 2017 · 0 comments

Comments

@evanceheallyg
Copy link

evanceheallyg commented Mar 28, 2017

Hello Team

Firstly, thanks for all the support provided. I have a following scenario which doesn't likely to seem working in timelion.

I have two indexes, one contains all the engine events and other contains the monthly wise hours of each engine.

I need to generate two month wise plot (one normal and other with moving average) with the below calculation:

(Month wise Number of IFSD Events/ Total sum of hours for the whole duration) * 100000

My current query calculates as below (pasted only the moving average query):

(Month wise Number of IFSD Events/ Month wise sum of hours) * 100000

(.es(index='ifree_product_event_new', timefield='date', q='engineInfo.inflightOnMissn:true',metric='count').divide(.es(index='ifree_monthly_prod_utils_new', timefield='date',metric='sum:monthlyProdHour').max())).multiply(100000).movingaverage(12).label('12 Months Moving Average')

Could you please guide me to the right direction. My problem is almost similar to whats mentioned in the below link.

http://elasticsearch-users.115913.n3.nabble.com/Calculating-rolling-average-using-aggregations-td4051482.html#a4075404

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant