Reloading a script in QlikView fails with ApplyMap error: map_id not found error.
Example script:
// Load mapping table of country codes:
//map1:
//mapping LOAD *
//Inline [
//CCode, Country
//Sw, Sweden
//Dk, Denmark
//No, Norway
//] ;
// Load list of salesmen, mapping country code to country
// If the country code is not in the mapping table, put Rest of the world
Salespersons:
LOAD *,
ApplyMap('map1', CCode,'Rest of the world') As Country
Inline [
CCode, Salesperson
Sw, John
Sw, Mary
Sw, Per
Dk, Preben
Dk, Olle
No, Ole
Sf, Risttu] ;
// We don't need the CCode anymore
Drop Field 'CCode';
Environment:
QlikView
Resolution
Avoid the error by ensuring that a mapping table is already loaded before using the ApplyMap() function.