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

Avg for dynamic range


I am looking to calculate an average of monthly 'Sales Volume' between the max(month) and a defined date (VSE End Date). If the VSE End Date is more than 12 months ago i want to cap the monthly average goinf back to just 12 months.

=

avg({<Month={'>=$(=max(Month)-column(8))<=$(=max(Month))'}>}[SALES VOLUME])

**Column(8) is where i calcualted the number of months since VSE End Date.

So for example I have a customer who has a VSE End Date of from December 2014 and to day is February 2015, so i would want an average of sales volume for the past 3 months (Dec, Jan, and Feb)

Any help would be greatly appreaciated.

3 Replies
MK_QSL
MVP
MVP

You mean to say Column(8) is the result of some expression, which could have different result on each line.

Please clarify !

Not applicable
Author

Yes, column(8) is the result of an expression that will be different for each customer.

MK_QSL
MVP
MVP

If possible provide sample data or apps..

What is the format of Month and Date fields?