Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 New-Qlik
		
			New-Qlik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 Vegar
		
			Vegar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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);
 Vegar
		
			Vegar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
		
			m_woolf
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Something like:
date(textbetween(<QVDFileName>,'_','.'),'YYYYMMDD') as QVD_Date;
.png) Brett_Bleess
		
			Brett_Bleess
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 New-Qlik
		
			New-Qlik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Actually both of them are right. Thanks for reminding.
