Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
michielvandegoo
Specialist
Specialist

For each + autogenerate + while gives .... -1, ....-2 tables

I have the following statement:

let aantal_te_loggen = NoOfRows('To_log');

for  loggen = 0 to NoOfRows('To_log')

let bestand_to_log = peek('bestand',loggen,'To_log');

Logbestand:

load  '$(bestand_to_log)' as Bestand,

  filetime('$(bestand_to_log)') as '$(bestand_to_log)'

AutoGenerate (1)

while 0 + IterNo( )-1 <= '$(aantal_te_loggen)';

next loggen

This should generate 1 table with the filename and the filetime based on a inline table with those filenames.

I do not get all results. I only get the second line from the inline table and for each  line a table with Logbestand-1, Logbestand-2 etc. etc.

What am I doing wrong?

1 Solution

Accepted Solutions
Not applicable

Michiel,

 

let aantal_te_loggen= NoOfRows('To_log');

for loggen= 0 to NoOfRows('To_log')-1

let bestand_to_log= peek('bestand',loggen,'To_log');

Logbestand:

load '$(bestand_to_log)' asBestand,
filetime('$(bestand_to_log)') as FileTime


AutoGenerate (1)
// while 0 + IterNo( )-1 <= '$(aantal_te_loggen)'

;

next loggen


NoOfRows -1 (because the start is 0)

as FileTime: to get a unique field name and get a unique table

//while (if you do not use iterNo(), why do you need to loop ?)

Hope this helps

Fabrice

View solution in original post

2 Replies
Not applicable

Michiel,

 

let aantal_te_loggen= NoOfRows('To_log');

for loggen= 0 to NoOfRows('To_log')-1

let bestand_to_log= peek('bestand',loggen,'To_log');

Logbestand:

load '$(bestand_to_log)' asBestand,
filetime('$(bestand_to_log)') as FileTime


AutoGenerate (1)
// while 0 + IterNo( )-1 <= '$(aantal_te_loggen)'

;

next loggen


NoOfRows -1 (because the start is 0)

as FileTime: to get a unique field name and get a unique table

//while (if you do not use iterNo(), why do you need to loop ?)

Hope this helps

Fabrice

mov
Employee
Employee

The tables in the loop have different structure, hence they don't collapse into one table.  What about this.

let aantal_te_loggen = NoOfRows('To_log');

Logbestand:
LOAD * INLINE [
Bestand];


for  loggen = 0 to NoOfRows('To_log')

let bestand_to_log = peek('bestand',loggen,'To_log');


CONCATENATE (Logbestand)

load  '$(bestand_to_log)' as Bestand,

  filetime('$(bestand_to_log)') as '$(bestand_to_log)'

AutoGenerate (1)

while 0 + IterNo( )-1 <= '$(aantal_te_loggen)';


next loggen