Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
A7R3
Contributor III
Contributor III

How to improve the expression to sum or average measures over rolling x weeks

Hi,

Hope to tap your expertise in improving the expression below.

I am using the following expression in a straight table to report the inventory value on Sat 12am every week, for the past 6 weeks. In the straight table, each column is one measure for the data in that day for that week.

=Sum({<$(vInvDate)={"$(=Date(Weekstart(Max($(vInvDate)), 0, 5)))"}>} TotalInventoryUSD)

to

=Sum({<$(vInvDate)={"$(=Date(Weekstart(Max($(vInvDate)), -6, 5)))"}>} TotalInventoryUSD)

 

Now I would like to have the average inventory value over the 6 weeks. Instead of add all the 6 sum expression then divided by 6, is there anyway to have a simpler expression to do the same?

 

Thank you in advance.

Labels (5)
0 Replies