Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm extracting a large amount of data from a SQL server database. There's a limit on the amount of data that can be pulled per query, so I need to query data quarter by quarter. I'm wondering if there's a for loop function in Qlikview load script that can automate this. So, I'm thinking something like.
For all quarters in current year and last two years
Data:
Load *;
SQL select *
From my table
Where mytable.quarter = quarter;
Concatenate (Although there are several select queries , I would like to have data loaded in the same table in qlikview)
Next quarter.
Is it possible or any other suggestions?
Thanks
Yvonne
If your table contains identifiable quarters, dsignated with for example a string like Q1, Q2, Q3 and Q4 (or anything else you can enumerate), the na FOR EACH loop like this will do:
FOR EACH vQuarter IN 'Q1', 'Q2', Q3', 'Q4'
Data:
LOAD ... ; // Not needed when no field modifications
SQL SELECT * FROM mytable WHERE mytable.quarter = '$(vQuarter)';
NEXT
QlikView will perform an AUTOCONCATENATE as soon as it detects similar loads.
Best,
Peter
If your table contains identifiable quarters, dsignated with for example a string like Q1, Q2, Q3 and Q4 (or anything else you can enumerate), the na FOR EACH loop like this will do:
FOR EACH vQuarter IN 'Q1', 'Q2', Q3', 'Q4'
Data:
LOAD ... ; // Not needed when no field modifications
SQL SELECT * FROM mytable WHERE mytable.quarter = '$(vQuarter)';
NEXT
QlikView will perform an AUTOCONCATENATE as soon as it detects similar loads.
Best,
Peter
I think this can be useful for you