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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
KPage
Contributor III
Contributor III

Prior Weeks Sales

Hi,

I am trying to calculate Prior Week Sales. Below is my Current Week expression. I though I was supposed to add a "-1" somewhere in the expression but I keep getting $0. Thank you

 

Sum({<[Week Ending]={'$(=Max([Week Ending]))'}>}[Retail Sales])

Labels (2)
3 Replies
brunobertels
Master
Master

Hi 

ma be this 

Sum({<[Week Ending]={'$(=Max([Week Ending])-1)'}>}[Retail Sales])

KPage
Contributor III
Contributor III
Author

Thank you, but when I do that the expression creates the data as a fraction

KPage_0-1693235107069.png

 

brunobertels
Master
Master

Hi 

What is the format of [Week Ending] exactly ? seems to be a date no ? 

So if it is the date of the ending week you need to add date format and substract 7 days :

Sum({<[Week Ending]={'$(=date(Max([Week Ending])-7,'DD/MM/YYYY'))'}>}[Retail Sales])