Qlik Community

Ask a Question

Qlik Sense Advanced Authoring

Discussion board where members can learn more about Qlik Sense Advanced Authoring.

Announcements
March 11, 2PM EST: Do More with Qlik - Getting Started wtih Qlik Sense SaaS - Redux. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
malradi88
Creator
Creator

Data Loop Query (Adding new field to table)

To Whom it May Concern,

I hope this finds you well and in good health. I am currently using the below script to load data. A new file is created every quarter with the  same file-name/fields which allows this data load loop to function.

My question is, if I decide to add a new field to the file this quarter (lets say date of birth) and added that field to the script below ... do I have to manually add that field to all past files or is there a function that will allow for this load loop to function where additional fields in new files are not present in the older ones.

Thank you in advance for your support 🙂

SCRIPT:

set vconcatenate=';';

for each file in filelist('lib://RANDOM (SERVER-qlik-01_qliksupport)//Q*.xlsx')

$(vconcatenate)

[TABLE]:

LOAD

"FIELD1",
"FIELD2",
Date#(mid(FileBaseName(),1,7),'QQ/YYYY') as Date,
' [$(file)]' as filename

from [$(file)]
(ooxml, embedded labels, table is [TRAINEES]);

set vconcatenate='concatenate';

next file

STORE TABLE INTO [lib://RANDOM (SERVER-qlik-01_qliksupport)//StorageSocial.qvd];

 

Best,

Mohammed

Labels (3)
1 Solution

Accepted Solutions
saran7de
Master
Master

You are using CONCATENATE here. It will take care of this issue.

View solution in original post

2 Replies
saran7de
Master
Master

You are using CONCATENATE here. It will take care of this issue.

View solution in original post

malradi88
Creator
Creator

Thank you! Yes the problem was I didn't do an initial wild card load before the transformations so it was giving me an error whenever I added a field.

Best,

Mohammed