Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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 (3)
0 Replies