Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Avg issue?

Hi All,

I need to find last 12 months avg sales..

=Sum({<[Invoice Date]={'>=$(=MonthStart(Max([Invoice Date]), -11))<=$(=Date(Max([Invoice Date])))'}>}Sales)

For this Expression I am getting Last 12 Month Sales Value, I need to get Avg of this Sales ?

Regards,

Helen

19 Replies
PrashantSangle

Hi,

=Avg({<[Invoice Date]={'>=$(=MonthStart(Max([Invoice Date]), -11))<=$(=Date(Max([Invoice Date])))'}>}Sales)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi,

Since number of months are constant to 12.

you can use the below.

Sum({<[Invoice Date]={'>=$(=MonthStart(Max([Invoice Date]), -11))<=$(=Date(Max([Invoice Date])))'}>}Sales)/12

Not applicable
Author

Hi Shruthi,

12 is Fine, but I need to get dynamically that value & didvided by sales is nothing but my avg..

regards,

Helen

Not applicable
Author

Hi,

in that case just replace Sum by Avg in your expression. It will calculate automatically

Not applicable
Author

HI Max,

I am getting Incorrect Value..Suggest me any other way..

Regards,

Helen

Not applicable
Author

Tried but it was not working ..

mdmukramali
Specialist III
Specialist III

Dear,

can you attach the sample file.

so that we can try to help you.

Thanks,

Mukram

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi

Try this  one

=Sum({<[Invoice Date]={'>=$(=MonthStart(Max([Invoice Date]), -11))<=$(=Date(Max([Invoice Date])))'}>}Sales)

/Count({<[Invoice Date]={'>=$(=MonthStart(Max([Invoice Date]), -11))<=$(=Date(Max([Invoice Date])))'}>} Distinct month([Invoice Date]))

mr_novice
Creator II
Creator II

Sales average per month for the last 12 month?