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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
bushpalaamarnat
Creator
Creator

creating date field using file name

could you please advise.

I am trying to load latest 6 file from a folder which is in the format as below

Capture2.PNG

Temp:

LOAD *,

Date(Date#(SubField(Left(filename(),8),'YYYYMMDD'),'MM/DD/YYYY')) as Date,

filename() as FileName

FROM

(qvd);

STORE Temp into (qvd);

I am not getting the required out put.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Made some other changes as well

Temp:

LOAD *,

     Date(Date#(Right(FileBaseName(), 8), 'YYYYMMDD'), 'MM/DD/YYYY')) as Date,

     FileName() as FileName

FROM

(qvd);

View solution in original post

3 Replies
sunny_talwar
MVP
MVP

Try with FileBaseName() instead of FileName() as FileName as picks up the file extension... .qvd or .xlsx

sunny_talwar
MVP
MVP

Read more about here

FileBaseName

sunny_talwar
MVP
MVP

Made some other changes as well

Temp:

LOAD *,

     Date(Date#(Right(FileBaseName(), 8), 'YYYYMMDD'), 'MM/DD/YYYY')) as Date,

     FileName() as FileName

FROM

(qvd);