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

Calculating Average Weeks and counting backwards based on Variable

Hi all ,

I have a table which has sales and Inventory.

I need to show the total sales for a certain time frame (week/year) and inventory as well, but also an average inventory.

If I select Year 2010 and Weeks 13, 14, 15 and 16 but use a variable for the number of weeks I want to use for Average Inventory what expression do I use?

Average Week Variable = 2 ( Inventory / inventory for weeks 15 and 16? )

How do I find and calculate week 16 and 15 average inventory? from week number = 16 (the highest number selected in the select data range)

If the Variable was 3, then I would need Total Inventory for the time frame chosen divided by the sum of Inventory weeks 16, 15 and 14.

Any assistance would be much, much appreciated.

Labels (1)
2 Replies
Not applicable

Hi Candiceb,

Do you have a the answer to this trouble? I'm trying to do the same and I'm really confused.

Thanks,

Not applicable

Hi,

This may help you a little bit, I use it for calculating the weeks of inventory base on average sales for previous 13 weeks.

Sum ([Inventory]) / RangeAvg( Before( SUM([Sales]),0,13))