Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shansundar
Partner - Creator
Partner - Creator

Not able to filter Sub routine result set

Hi Qlikers,

I'm having an issue in extracting the particular txt file from the task log folder. So, I got the below sub routine from community and modified accordingly to do my task as below,

sub ScanFolder(Root)

  for each FileExtension in 'txt'

  for each FoundFile in filelist( Root & '\*.' & FileExtension)

  FileList:

  LOAD '$(FoundFile)' as SourceFile,

  FileTime( '$(FoundFile)' ) as Filetime

  AUTOGENERATE 1;

  Set vConcatenate = Concatenate;

  next FoundFile

  next FileExtension

  for each SubDirectory in dirlist( Root & '\*' )

  call ScanFolder(SubDirectory)

  next SubDirectory

end sub;

Step 1 : Call the sub routine to extract all the txt files from the root folder (including sub folders).

Call ScanFolder ('myfolder\Log');

Step 2 : Do a resident load from the sub routine result set table and then filter the data based on the task name.

FinalFileList:

LOAD

SourceFile,

Filetime

RESIDENT FileList

WHERE SourceFile LIKE '*Reload_Task_Check';

But after this step 2 I'm not getting the desired result. Only the FileList table is there, but not the FinalFileList table is generated.

Can you please help me here.

Thanks,

Shan S

1 Solution

Accepted Solutions
maxgro
MVP
MVP

It seems to me the FinalFileList has the same number and names of fields of the FileList table

Qlik will concatenate Final.... to FileList

add a noconcatenate

FinalFileList:

NOCONCATENATE

LOAD

SourceFile,

Filetime

RESIDENT FileList

WHERE SourceFile LIKE '*Reload_Task_Check';

View solution in original post

2 Replies
maxgro
MVP
MVP

It seems to me the FinalFileList has the same number and names of fields of the FileList table

Qlik will concatenate Final.... to FileList

add a noconcatenate

FinalFileList:

NOCONCATENATE

LOAD

SourceFile,

Filetime

RESIDENT FileList

WHERE SourceFile LIKE '*Reload_Task_Check';

shansundar
Partner - Creator
Partner - Creator
Author

Thanks it works fine