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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ljackson
Creator
Creator

How do I write an expression utilizing the current week number?

I want to create an expression that calculates the average weekly sales of a product.  I have the total of sales, but can't see how automatically include the current week number as a differential.

I have tried using the 'average' function, but this just averages the total number of entries - there will be more than one entry per week.

Can I use the current day to identify the current week, and then use that in the expression?

Thanks in advance for any help.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

week(today()) will return the week number of today. So perhaps sum(Sales)/week(today()) is what you're looking for.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Not applicable

If you want to just calculate the weekly average of sales(not the evolution), you can do:

sum(Sales)/Week(Date(Today))

Is that what you are looking for?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

week(today()) will return the week number of today. So perhaps sum(Sales)/week(today()) is what you're looking for.


talk is cheap, supply exceeds demand
ljackson
Creator
Creator
Author

Thank you, that worked a treat!