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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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.

0 Replies