Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with monthly rolling AVG

Hi All,

I have data with list of item nos for which i want to show avg for last 2/3 month.

I have attached test qvw which consist data for only one item no.

Tried formula: =avg(Consumed) & =aggr(Avg(Consumed),MONTH,[Item No])


however its not showing proper avg..

test11.PNG

Would like to show monthly avg for all item no in pivot table & for some items in text box like shown in above image. 

1 Solution

Accepted Solutions
prat1507
Specialist
Specialist

Use

=(FirstSortedValue(Aggr(Sum(Consumed), MONTH,[Item No]), Aggr(Sum(DISTINCT(MONTH)), MONTH,[Item No]), 1)

+FirstSortedValue(Aggr(Sum(Consumed), MONTH,[Item No]), Aggr(Sum(DISTINCT(MONTH)), MONTH,[Item No]), 2))/2

View solution in original post

3 Replies
prat1507
Specialist
Specialist

Use

=(FirstSortedValue(Aggr(Sum(Consumed), MONTH,[Item No]), Aggr(Sum(DISTINCT(MONTH)), MONTH,[Item No]), 1)

+FirstSortedValue(Aggr(Sum(Consumed), MONTH,[Item No]), Aggr(Sum(DISTINCT(MONTH)), MONTH,[Item No]), 2))/2

ajaysingh29
Contributor III
Contributor III

Try this:

=AVG(Aggr(sum(Consumed),MONTH,[Item No])) 

Anonymous
Not applicable
Author

Thank you