Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Average over the past 3 months

Hey everyone,

I have got the sales for each day since the beginning of the year.

I would like to calculate the average sales per month over the last 3 months.

I want to use a set analysis like :

sum ({<[Month_year]= {[Month_year] > Addmonths( CurrentMonthYear,-3)}>}  [Sales])

Of course, this syntaxe doesn't work. any idea ?  

3 Replies
migueldelval
Valued Contributor

Re: Average over the past 3 months

Hi Laura,

Try with

rangeavg(Above(sum( [Sales]),0,3)

Regards

Miguel del Valle

Not applicable

Re: Average over the past 3 months

Hi Miguel, thanks for your reply.

It doesn't work because I don't have the month in dimension of my graph (and I don't want it).

I just have a table with

Store   AvgSales per month over the past 3 months

A                  33

B                  30

C                  16

roharoha
Valued Contributor III

Re: Average over the past 3 months

=sum({<[Month_year]={">=$(=AddMonths(max(total [Month_year]),-2))"} >} value)