Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

File path automation

Hi ,

Previously we have three qvd files QVDABCDev ,QVDABCQA , QVDABCProd in one folder  so we were reading qvds as given below.

FOR Each files in FileList('$(vQVDPath)\QVDABC*.qvd')

now we have created separate folder for Dev/QA/Prod and placed QVDABCDev in Dev folder, QVDABCQA  in QA folder and QVDABCProd   in prod folder.


Now we want to change the above code so that it will go to each folder and read the qvd.


Please let us know any way to do it.


2 Replies
vishsaggi
Champion III
Champion III

IF you have separate server paths store them into 3 individual variables and concatenate those QVDs accordingly.

Like

SET vQVDPath1 = 'YourDEVpath here\';

SET vQVDPath2 = 'YourQApath here\';

SET vQVDPath3 = 'YourPRODpath here\';

LOAD *

FROM $(vQVDPath1)\QVDABCDev.qvd(qvd);

CONCATENATE

LOAD *

FROM $(vQVDPath2)\QVDABCQA.qvd(qvd);


CONCATENATE

LOAD *

FROM $(vQVDPath3)\QVDABCProd.qvd(qvd);

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to look through the folders, you can use below sub routine to do that.

sub DoDir (Root)

   for each Ext in 'qvd'

      for each File in filelist (Root&'\*.'&Ext)

         LOAD

            '$(File)' as Name,

            FileSize( '$(File)' ) as Size,

            FileTime( '$(File)' ) as FileTime

         autogenerate 1;

      next File

   next Ext

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

      call DoDir (Dir)

   next Dir

end sub

call DoDir ('C:')

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!