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

Multiple For Each...Next in Load Script

Hello All,

I'm looking to load my Data from a Datalake to Qlik with multiple For each....next loops.

For Each Year in ($Year)

      -  ($Year has a list of all the Years 2019,2018)

For Each Month in ($Month)

      - ($Month has a list of all the Months 1,2,3,4,5,6...)

For Each Date in ($Date)

      - ($Date has a list of all Dates 1,2,..31)

For Each Hour in ($Hour)

     - ($Hour has list of all Hours 1,2,..24)

[Data]:

LOAD

 *

from Table

Where Year=($Year) and Month=($Month) and Day=($Day) and Hour=($Hour);

STORE * from [Data] into ($Year)($Month) ($Day)($Hour)_Data.qvd;

Drop Table Data;

 

Next Year

Next Month

Next Day

Next Hour

 

Exit Script;

 

This Script doesn't work as expected with multiple For Each Next conditions. Can any one please suggest how to handle such cases involving multiple loops.

 

TIA!!

Labels (1)
12 Replies
lorenzoconforti
Specialist II
Specialist II

QlikSense example

lorenzoconforti
Specialist II
Specialist II

QlikView example

Sai33
Partner - Creator
Partner - Creator
Author

Hi, 

Thanks for all your cool tips. I'm using Qlik Sense and your example application was the closest to the solution i'm looking for.