Skip to content
This repository was archived by the owner on Nov 22, 2017. It is now read-only.
This repository was 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

@evanceheallyg

Description

@evanceheallyg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions