Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
kgershman
Partner - Contributor II
Partner - Contributor II

Find all Apps that Load a given QVD file

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?

1 Solution

Accepted Solutions
kenphamvn
Creator III
Creator III

Hi

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' )

FileList_TMP:

Load

  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

NoConcatenate

FILE_QVD_TABLE:

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

,ReloadTime

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

Regards

An Pham

View solution in original post

5 Replies
kgershman
Partner - Contributor II
Partner - Contributor II
Author

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.

kenphamvn
Creator III
Creator III

Hi

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' )

FileList_TMP:

Load

  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

NoConcatenate

FILE_QVD_TABLE:

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

,ReloadTime

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

Regards

An Pham

kgershman
Partner - Contributor II
Partner - Contributor II
Author

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.

brianwolko
Contributor
Contributor

You made an amazing job!

is there any clue about how to get the app name also?

 

Thank you so much

krmvacar
Creator II
Creator II

Hi @kenphamvn 

Thank you very much for the code, it was very useful. Here it is.
I have a small question. When I run the code, if there is a commented qvd in the app, it sees it too and shows more qvds. How can I separate them?

İn App:

krmvacar_0-1694190729727.png

 

show result 

krmvacar_1-1694190854079.png

Can you help about this?

Thank you so much