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: 
countwise
Contributor III
Contributor III

Compare Weekly Average with Previous Weeks Weekly average

I am new to Qlik and could do with some help. I have an expression that that returns a Weekly average for a selected period.

(Avg(Aggr(Sum(if([SensorFunction]='Mall Entrance',[Traffic], Null())),Week)))

I would like to be able to show the weekly average for the previous week.

Any help would be gratefully received

Jim

2 Replies
Gysbert_Wassenaar

Maybe like this:


Avg({<Period=,Week={'$(=Max(Week)-1))'}>}Aggr(Sum({<Period=,Week={'$(=Max(Week)-1))'},[SensorFunction]={'Mall Entrance'}>}[Traffic]),Week))


I don't know if you have a field called Period and I don't know either if your Week field contains numbers that increase by 1 for each month. You may have to adjust things accordingly.


talk is cheap, supply exceeds demand
countwise
Contributor III
Contributor III
Author

Many Thanks for this, unfortunately it does not return a value.

I do have a field called Period and week numbers increase by 1 each week.

(Period has replaced month)

Any further help would be appreciated

Jim