3 Replies Latest reply: Jan 29, 2014 11:40 AM by Muhammad Asim RSS

    How to get filename and date of last change from excel file?

    Harshvardhan Tiwari

      Hi,

       

      is it possible to get the current filename name and make date using qlikview expressor?

       

      Thanks!

        • Re: How to get filename and date of last change from excel file?

          To retrieve the name of the file being processed you would need to supply the file name to the input operator through a configuration/parameter setting.

           

          To also retrieve the timestamp for the file you would need to add some scripting to your application that retrieves this information before you begin processing the files.  This type of application is best developed using Expressor Standard or Expressor Enterprise Editions.

          • Re: How to get filename and date of last change from excel file?

            Hello Harsh,

            We can use "*" wildcard to read all the files in a particular location.

            e.g. "C:\My Documents\*.csv"

             

            Following code might help you in reading all the files (.csv in this case)

             

            SET vFolderName= C:\Users\Desktop\FolerName;  // Define the Folder location here

            FOR each vFile in filelist('$(vFileBaseName)\*.csv')    

                 load *   

                 from $(vFile) (txt, codepage is 1252, embedded labels, delimiter is ',', msq);        

                 LET vTime = num(now());              

                 SET vFilenanme_$(vTime)= $(vFile) ;

            NEXT;

             

            The code logic is pretty simple it is creating vFilename with numeric timestamp stamp and then storing all the files (csv) getting loaded in the loop.

            It will work full proof if the tables getting loaded takes more than 1 second to lot as in that the value of vTime variable will change and a new variable will be created for each file.

             

            Hope this helps...

            • Re: How to get filename and date of last change from excel file?

              Its Very Easy only simple function.

               

              FileBaseName()