2 Replies Latest reply: Mar 20, 2017 11:43 PM by Shanmuga S RSS

    Not able to filter Sub routine result set

    Shanmuga S

      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