Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
New-Qlik
Creator II
Creator II

Extrat Date from QVD file name

Hello,

 

I want to extract and save date from QVD file name eg

Sales_20180101.qvd

Sales_20180102.qvd

 

i want a date column having dates like 20180101 and 20180102 and is link with data in corresponding QVDs

TIA

 

1 Solution

Accepted Solutions
Vegar
MVP
MVP

You can use FileBaseName() to fetch the file base name, subfield() to fetch the integer representing the date and date#() to intepret the integer. Dayname() is used just for the correct presentation of your date. 

LOAD
*,
DayName( date#( subfield(FileBaseName() , '_',2),'YYYYMMDD' ))as FileDate

FROM *.QVD (qvd); 

View solution in original post

4 Replies
Vegar
MVP
MVP

You can use FileBaseName() to fetch the file base name, subfield() to fetch the integer representing the date and date#() to intepret the integer. Dayname() is used just for the correct presentation of your date. 

LOAD
*,
DayName( date#( subfield(FileBaseName() , '_',2),'YYYYMMDD' ))as FileDate

FROM *.QVD (qvd); 

m_woolf
Master II
Master II

Something like:

date(textbetween(<QVDFileName>,'_','.'),'YYYYMMDD') as QVD_Date;

Brett_Bleess
Former Employee
Former Employee

Avneet, did Vegar or Mike's posts help you get things working?  If so, be sure to come back to the thread and use the Accept as solution button on the post that worked best for you to give them credit for the help and let other Community Members know which worked best for your use case.  If you are still working on things, please leave an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
New-Qlik
Creator II
Creator II
Author

Actually both of them are right. Thanks for reminding.