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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
Champion III
Champion III

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
Champion III
Champion III

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