Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
thierrytt1102
Partner - Creator II
Partner - Creator II

Global File Time Overview

HI all,

Is there an easy way to retreive the file times of every QVD loaded into the data model? (but not with an individual treatment)

So that the user can see if some of the QVD are well refreshed.

I was thinking of a QV Component or something like that. !?!

Thanks for you help

3 Replies
Gysbert_Wassenaar

Use the filetime() function:

SourceTimes:

First 1

LOAD filename() as FileName , filetime() as FileTime FROM *.qvd (qvd);


talk is cheap, supply exceeds demand
thierrytt1102
Partner - Creator II
Partner - Creator II
Author

thx Gysbert,

Useful but as you can assume, all my QVD are not in the same place 😕

So I should find a function that could list all my QVD path, store it into a table and find the file time of every QVD.

grtz

Gysbert_Wassenaar

Perhaps something like this:

sub ScanFolder(Root)

    for each FileExtension in 'qvd'

        for each FoundFile in filelist( Root & '\*.' & FileExtension)

            FileList:

            Load

            '$(FoundFile)'               as [FilenameWithPath],

            FileTime('$(FileExtension)') as [FileTime]

            Autogenerate(1);

        next FoundFile

    next FileExtension

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

  call ScanFolder(SubDirectory)

    next SubDirectory

end sub

Call ScanFolder('.') ;


talk is cheap, supply exceeds demand