Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

The problem with loop

To execute the query and write it line by line in CSV file:

SET MinDate = '01.01.2008';

SET MaxDate = '31.12.2009';

let IntervDate =Date(MinDate+1);

DO WHILE MinDate<>MaxDate

StTable:

LOAD [Location Code],SUM([Quantity]) Resident RawData

WHERE [Entry Type]='Buy' AND DateForRaw<=$(MinDate)

GROUP BY [Location Code];

STORE StTable into Table.csv;

DROP TABLE StTable;

let MinDate =Date(MinDate+1);

LOOP

2016-08-20_14-50-17.png

I need help.

1 Reply
swuehl
MVP
MVP

Try enclosing the date variable expansion into single quotes:

LOAD [Location Code],SUM([Quantity]) Resident RawData

WHERE [Entry Type]='Buy' AND DateForRaw<='$(MinDate)'

GROUP BY [Location Code];