Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
malradi88
Creator II
Creator II

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 (4)
1 Solution

Accepted Solutions
Saravanan_Desingh

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

View solution in original post

2 Replies
Saravanan_Desingh

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

malradi88
Creator II
Creator II
Author

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