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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
asmithids
Partner - Creator II
Partner - Creator II

Current Week Ending Date vs. Prior Year Week Ending Date

Hello,

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
hector_munoz
Specialist
Specialist

Hi Alec,

Try the following expresion:

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

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

Regards,

H