Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

date generator

good afternoon

I would like to help me'm trying to generate a date from the name of a QVD.

example my QVD is called F_MAYA_DETALLE_07102016.qvd there is a function for me to take the date on my qvd is 07,102,016

Thank you

regards

Luis Espinoza

1 Solution

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Luis,

There is a filename function.  You should be able to do something like this in your load:

LOAD
    Date(Date#(Left(Right(FileName(), 12), 8), 'DDMMYYYY'), 'DD MMM YYYY') as [File Date],

    ... load other fields here ...

There is a reasonably high chance that I have miscounted the characters in the suffix, but hopefully that should give you a good idea on how to get the date you require.

Steve

View solution in original post

2 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Luis,

There is a filename function.  You should be able to do something like this in your load:

LOAD
    Date(Date#(Left(Right(FileName(), 12), 8), 'DDMMYYYY'), 'DD MMM YYYY') as [File Date],

    ... load other fields here ...

There is a reasonably high chance that I have miscounted the characters in the suffix, but hopefully that should give you a good idea on how to get the date you require.

Steve

MarcoWedel

maybe helpful:

Date(Date#(Subfield(FileBaseName(),'_',-1),'DDMMYYYY')) as YourQVDDate

regards

Marco