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

ApplyMap with exception

I've been struggling for a while@ now with the ApplyMap function. This is because one entry can not follow the original mapping structure. In my example the Netherlands should be mapped to Europe but there is one exception (sales related) as to why it should be linked to Africa. Both countries 'the Netherlands' do have a unique customer number. I tried countless ApplyMaps within the ApplyMap function but can't get it working.

Anyone suggestions?

Much appreciated.

ApplyMap('Mapping_Continent',Country, '') as Continent

Original Mapping Preferred Mapping
CountryContinent CountryContinent
the NetherlandsEurope the NetherlandsEurope
GermanyEurope the NetherlandsAfrica
SpainEurope GermanyEurope
South AfricaAfrica SpainEurope
South AfricaAfrica

Regards,

René

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Have you tried something like ?

If(Country='the Netherlands', 'Africa', ApplyMap('Mapping_Continent',Country)) as Continent

View solution in original post

4 Replies
tresesco
MVP
MVP

Have you tried something like ?

If(Country='the Netherlands', 'Africa', ApplyMap('Mapping_Continent',Country)) as Continent

sujeetsingh
Master III
Master III

It can be done by nested if statement.

Not applicable
Author

One option may be create a flag field in the mapping with that special cases and map them with a condition.

This Way:

countrymap:

CountryContinent
the NetherlandsEurope
the Netherlands-EspecialAfrica
GermanyEurope
SpainEurope
South AfricaAfrica

Table_to_apply_mapping:

LOAD * , ApplyMap('countrymap',Country&if(<EspecialCondition>,'-Especial'),'') as Continent

RESIDENT Source_Table;

Not applicable
Author

Hi Tresesco. Thanks for guiding me in the right direction. I found that one 'the Netherlands' has a specific customer group linked to it. In the end this was the statement that did it for me:

if(CustGroupDesc='Export','Africa',ApplyMap('Mapping_Continent',Country,'')) as Continent

Thanks again and regards,

René