Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm a newbie. Currently I am using nested IFs in a LOAD statement. Something like this:
LOAD Region,
IF (Region='UK','Europe',
IF (Region='Germany','Europe',
IF (Region='France','Europe, Region) AS WWRegion,
This works fine but I am loading several tables from several data sources and have to use this same structure and values in several LOAD statements. If I add another country to Europe, I need to go modify the script in several places. I am wanting to setup some sort of variable that is a table or set of values. Something like this:
SET EUCountries = {'UK','Germany','France'};
LOAD Region
IF (Region=EUCountries,'Europe',Region) AS WWRegion,
Is this something that can be done in a QlikView script? If so, what is the specific syntax?
Any help is appreciated. Thanks!
Use of mapping tables will be an easier and generalized approach.
1. Creata a mapping table with country as key and region as the mapped field
2. 'applymap' the region against the country whenever you load data from the respective QVD.
Initial SQL load need to require any conditional if in this case.
--Arun
Use of mapping tables will be an easier and generalized approach.
1. Creata a mapping table with country as key and region as the mapped field
2. 'applymap' the region against the country whenever you load data from the respective QVD.
Initial SQL load need to require any conditional if in this case.
--Arun
Thanks Arun. I'll give this a try.
Regards.