Skip to main content
Sept. 27, 10AM ET Do more with Qlik, Insight Advisor – our intelligent AI-assistant in Qlik Sense: Register
Showing results for 
Search instead for 
Did you mean: 
Partner - Creator II
Partner - Creator II

Current Week Ending Date vs. Prior Year Week Ending Date


I am trying to show current weekending sales in a straight table column and the prior year weekending date sales in another column.  The expression for the current year is straight forward (i.e. Sum(Sales) ).  However, I am having trouble getting the prior year weekending date sales.  I tried the following expressions to not success. 

  • Sum({$<Year={$(=Max(Year)-1) >} Sales)
  • Aggr(Sum({$<Year={$(=Max(Year)-1)}>} Sales ),WeekEndDate)
  • Sum({$<WeekEndDate={$(=Date(Num(WeekEndDate))-364)} Sales )
  • Sum({$<WeekEndDate={'WeekEndDatePY'} Sales )

Attached is the sample data set to compute the Prior Year Week End Date. 

I researched the forum extensively before posting this issue but, could not find a posting pertaining to my question.  A few were close to my question but, could not get it to work. 

Thank you in advance for any assistance. 

1 Reply

Hi Alec,

Try the following expresion:

Sum({<Year={$(=Max(Year)-1)}>} TOTAL Sales)

I assume you have no dimensions or only Year as dimension...