Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create date field using file names in incremental load

Hi All,

PFA

I  would like to concatenete QVD files and create a date field based on the QVD filename ,these files are sitting in one of the folders in my computer. Please below.

Test_.PNG

3 Replies
Clever_Anjos
Employee
Employee

Load *,

Right(Subfield(Filename(),'.',-1),10) as Date

From [Folder\GENERAL_ACCT_MAST_TABLE_GH_*.QVD](QVD);

its_anandrjs

Write this way in load script for loading all qvds at once and by using filebasename create the datefield.

LOAD *

Date(Date#( SubField( FileBaseName() ,'_',-1),'YYYYMMDD'),'YYYYMMDD') as DateField

FROM

D:\Qcomm\GENERAL_ACCT_MAST_TABLE_*.qvd

(qvd);


Or


LOAD *

Date( SubField( FileBaseName() ,'_',-1),'YYYYMMDD') as DateField

FROM

D:\Qcomm\GENERAL_ACCT_MAST_TABLE_*.qvd

(qvd);

its_anandrjs

Also try this you have to write this for identifying file name as well

LOAD

*

SubField( FileBaseName() ,'_',-1) as DateField,

FileBaseName() as FileName

FROM

GENERAL_ACCT_MAST_TABLE_GH_*.qvd (qvd);


FileName.PNG