3 Replies Latest reply: Nov 22, 2017 2:44 PM by Sunny Talwar RSS

    Dates in SetAnalysis

    Juan Moreno

      Hi,

       

      I keep trying to figure out the correct way to deal with dates in set analysis. This time I'm trying to calculate the average for values corresponding to the last 52 weeks.

       

      I thought that a >= condition to start from the week 364 days ago and a <= condition for today's week would be enough:

       

      Avg({<start_date={">=$(WeekStart(Date(Today()-364,'MM/DD/YYYY')))"}, start_date={"<=$(WeekStart(Date(Today(),'MM/DD/YYYY')))"}, event_status_id={'31'}>}verification_time)

       

      It doesn't seem to be working since I can see that removing the two start_date conditions, I keep getting the same results in the chart. Qlik Sense is not notifying of any syntax error, but in previous times I've got recommendations from users in this community to slightly modify the expression and make it work.

       

      Any idea?

       

      Thanks much