1 Reply Latest reply: Apr 7, 2017 2:16 AM by Muñoz Héctor RSS

    Current Week Ending Date vs. Prior Year Week Ending Date

    Alec Smith



      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.