Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Loop Function Not working

I have all the application names and their logs present with the same name folder  in TableA and i want to search the logs and read them for all applications .

I want my loop to run for each application in tableA and put their stats into TableB where column appu contains path of the log file and ApplicationName1 contain name of the application .

Below loop is running once only and giving me details for 1 application . Can anybody please help.

for i=0 to i= NoOfRows(tabaleA)-1;

//for each file in '$(tabaleA)'

let rty=Peek('appu',$(i),'tabaleA');

tableB:

first 1

LOAD

Peek('ApplicationName1',$(i),'tabaleA')&Date(today(),'DD/MM/YYYY hh:mm:ss') & if (FileTime('$(rty)\DocumentLog.txt')>'01/06/2018 13:28:52','Evening','Morning') as PKey,

Date(FileTime('$(rty)\DocumentLog.txt'),'hh:mm:ss') as EndTime,

SubField(@3,' ',2) as startTime,

time((Date(FileTime('$(rty)\DocumentLog.txt'),'hh:mm:ss') - SubField(@3,' ',2)),'hh:mm:ss') as duration,

@1,

     @2,

     @3

FROM

[$(rty)\DocumentLog.txt]

(txt, utf8, no labels, delimiter is '\t', msq);

NEXT i;

1 Reply
m_woolf
Master II
Master II

for i=0 to i= NoOfRows(tabaleA)-1;    should be:

for i=0 to NoOfRows(tabaleA)-1;