Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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);