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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculating average upto the month

Hi All,

     Please find the attached excel book below. It contains two table, left one is the detailed data by year, month, day. and the right one is the required output.

     I need an idea for how to write a script or an expression in the chart that will calculate the average by month.

     for example:

YearMonthSumAverage
201211492314923.00
201221563915281.00
201231609415552.00

In the above table the average value is calculated like For month Jan, avg is 14923/1=14923, For feb avg is 14923+15639/2=15281 and so on. We can call it as accumulated avg by month.

In qlikview, I struggling to calculate this avg value.

Please help me in this.

Thanks in advance.

1 Solution

Accepted Solutions
Not applicable
Author

Guys,

     Thanks for trying.

     I've found the solution.

     In expression, above(Value, 0, 12) can be used to calculate the average of last 12 months.

     After that it can be aggregated by year and month using aggr method.

     Thanks to all of you.

Regards

Rajan

View solution in original post

4 Replies
Not applicable
Author

Try this....showing correct Ave for 2012 but for year change it again restarts....

found the attached QVW file

hope it help you

Ave.PNG

Regards

Arun Goel

Not applicable
Author

if u get better solution then this...plz share..

jvitantonio
Specialist III
Specialist III

Hi, Here's the complete solution for your problem.

I hope it's helpful.

Not applicable
Author

Guys,

     Thanks for trying.

     I've found the solution.

     In expression, above(Value, 0, 12) can be used to calculate the average of last 12 months.

     After that it can be aggregated by year and month using aggr method.

     Thanks to all of you.

Regards

Rajan