0 Replies Latest reply: Sep 20, 2010 7:38 PM by Deanna Legg RSS

    Load a yearly snapshot of data

      Hi,

      I need to read in a yearly snapshot of data. I can write the code in a SQL procedure like this:

      SET @MaxDate = '2010-08-15'
      SET @CurrentDate = '2000-08-15'

      WHILE @CurrentDate <= @MaxDate
      SELECT DATA1
      FROM TABLE
      WHERE DATE = @CurrentDate

      SELECT @CurrentDate = DATEADD(yy, 1,@CurrentDate)
      END

      How can I write the equivalent logic using QlikView syntax?
      I am not sure how to structure the loop and how to increment the date.

      Thanks.