Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Average of the past three years based on selection

What function/expression could I use to average the sum of something over the past three years (based on the user selecting a year)?

Thanks

Greg

22 Replies
Anonymous
Not applicable
Author

My last expression is not a proportion.

Regards!

sunny_talwar

I guess I understand your issue, you need to ignore selection in academic year field

Sum({<Year={">$(=max(Year)-3)<=$(=Max(Year))"}, source={'HESASTUD'},gender ={'Male'}, academic_year>} head) /

Sum({<Year={">$(=Max(Year)-3)<=$(=Max(Year))"}, source={'HESASTUD'}, academic_year>} head)

Capture.PNG

Anonymous
Not applicable
Author

Thanks for all your help guys.