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.

johflo
New Contributor III

How to load the "last changed" date from files

Hello, I would like to load the "last changed" date of several qvd files. For example a file called Budget.qvd, last changed 2013-09-04 - then I would like "2013-09-04" as a value in a field in the QV app. Is this possible?

1 Solution

Accepted Solutions
MVP
MVP

Re: How to load the "last changed" date from files

Are you referring to the last modification timestamp of the file or some internal data table?

If you are after the file timestamp, look into

filetime([ filename ])

Returns a timestamp for the date and time of the last modification of the file filename. If no filename is specified, the function will refer to the currently read table file.

Examples:

filetime( 'xyz.xls' )

Will return the timestamp of the last modification of the file xyz.xls.

Load *, filetime() as X from abc.txt ;

Will return the date and time of the last modification of the file (abc.txt) as a timestamp in field X in each record read.

or

QvdCreateTime(filename)

Returns the XML-header time stamp from a QVD file if any (otherwise NULL).

The filename is the name of a QVD file, if necessary including path.

Examples:

QvdCreateTime('MyFile.qvd')

QvdCreateTime('C:\MyDir\MyFile.qvd')

3 Replies
MVP
MVP

Re: How to load the "last changed" date from files

Are you referring to the last modification timestamp of the file or some internal data table?

If you are after the file timestamp, look into

filetime([ filename ])

Returns a timestamp for the date and time of the last modification of the file filename. If no filename is specified, the function will refer to the currently read table file.

Examples:

filetime( 'xyz.xls' )

Will return the timestamp of the last modification of the file xyz.xls.

Load *, filetime() as X from abc.txt ;

Will return the date and time of the last modification of the file (abc.txt) as a timestamp in field X in each record read.

or

QvdCreateTime(filename)

Returns the XML-header time stamp from a QVD file if any (otherwise NULL).

The filename is the name of a QVD file, if necessary including path.

Examples:

QvdCreateTime('MyFile.qvd')

QvdCreateTime('C:\MyDir\MyFile.qvd')

johflo
New Contributor III

Re: How to load the "last changed" date from files

Thanx, FileTime() was what I was looking for. Not really sure what QvdCreateTime() is. Is that when the store was initiated?

cesaraccardi
Valued Contributor

Re: How to load the "last changed" date from files

Hi,

If you move the qvd from a folder to another you will have a different result for FileTime() whereas QvdCreateTime() will still give you the date when data was stored into the file.

Regards,

Cesar