Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

thierrytt
Not applicable

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
Not applicable

Re: Global File Time Overview

Use the filetime() function:

SourceTimes:

First 1

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


talk is cheap, supply exceeds demand
thierrytt
Not applicable

Re: Global File Time Overview

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
Not applicable

Re: Global File Time Overview

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