3 Replies Latest reply: Jan 2, 2018 1:52 PM by Kyle Gershman RSS

    Find all Apps that Load a given QVD file

    Kyle Gershman

      I've got a single APP whose objective is to read SQL Tables and generate QVD files.


      I then have a series of Apps that then read those QVD files.  Any given QVD file may be used in one more more Apps.


      I'm trying to figure out, for impact analysis, what Apps would be impacted if a QVD file is changed.


      I can't locate the proper API methods.  And it appears that once the data is loaded and the search index is produced, the APIs that read the App data are only looking at the "tables" that have already been rendered independent of the source.


      Perhaps there are APIs that I haven't found that can read the Data Load scripts?

        • Re: Find all Apps that Load a given QVD file
          Kyle Gershman

          There is a GetScript method on the App object, but that's pretty raw and a pain to parse out the QVD files.


          Still hoping for something more basic that would represent the source files/databases, etc., that are used by an App.

          • Re: Find all Apps that Load a given QVD file
            An Pham


            You can using script to read log files and find all apps that load QVD files

            1. Create a folder  connection (ex  'Log_Folder' ) to Scripts log folder  (ex:..\Qlik\Sense\Log\Script)
            2. Read data from Logs file by this script (you can edit if you want )


            for each FoundFile in filelist( 'lib://Log_Folder ' & '\*.log' )
              left(Right('$(FoundFile)', len('$(FoundFile)') -index('$(FoundFile)','/',-1)),36) as App_ID
              ,Replace(@1,'/','\') as QVD_FILES
            ,FileTime('$(FoundFile)') as ReloadTime
            FROM '$(FoundFile)'
            (txt, utf8, no labels, delimiter is '\t', msq)
            where Upper(@1) like '*.QVD*';
            next FoundFile
            load App_ID,
            left(Right(QVD_FILES,len(QVD_FILES)-Index(QVD_FILES,'\',-1)),len(Right(QVD_FILES,len(QVD_FILES)-Index(QVD_FILES,'\',-1)))-1)  as  QVD_FILES
            Resident FileList_TMP
            where App_ID <>'13470956-078b-4287-a711-c055f9449fa1'; // exclude Current App
            Drop Table FileList_TMP;


            Here is my result

            1-2-2018 10-45-11 AM.png


            An Pham

              • Re: Find all Apps that Load a given QVD file
                Kyle Gershman

                This gets me close enough to mark as correct for anyone else who comes by.

                Ideally, I'd only read the logs of a given timeframe to avoid getting duplicate counts.  Also, I'd need a way of excluding from QVD_Files those entries that are the timestamped log entries and not the parsed QVD rows.


                Thanks for the creativity of examining the logs.


                The GetScript api would also work, but would need to be parsed to find the QVD files.