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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
KirstenKa
Creator II
Creator II

Join 2 columns and add column after join

I am currently using excel files from sharepoint to upload in my script. Now I have 2 datafiles which are the same but from a different Region, Region US and Region Europe. Now I would like to upload both files, join them and after joining create 1 joined file (in the loadscript) an in this joined file I would like to add a column which is saying if the item/row in the dataset is from Europe or US

Labels (1)
2 Replies
BrunPierre
Partner - Master II
Partner - Master II

Hi, While loading data from each file, add a calculated field named Region to distinguish between Europe and US data.

USData:
LOAD *,
'US' as Region
FROM abc;

Concatenate
EuropeData:
LOAD *,
'Europe' as Region
FROM xyz;

NoConcatenate
AllData:
LOAD * Resident USData;

DROP Table USData;

KirstenKa
Creator II
Creator II
Author

Hi thanks @BrunPierre Sorry for the late reaction but it took a while before I started working on this issue. When I add 'US' as Region to my code it doesn't accept it because US is not in my datafile as a column Region,  and I would like to avoid that I need to manually add a column Region US in my datafiles. Is there a way to add it in the script or the only way is to manually add a column Region US in my datafile?