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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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.

Labels (1)
1 Reply
swuehl
Champion III
Champion III

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];