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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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.

1 Solution

Accepted Solutions
sunny_talwar

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

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

sunny_talwar

Read more about here

FileBaseName

sunny_talwar

Made some other changes as well

Temp:

LOAD *,

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

     FileName() as FileName

FROM

(qvd);