Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Nolgath
Creator
Creator

Script issue with Mapping Load

I am having problems with this syntax, it tells me map_id does not exist

error: "ApplyMap error: map_id not found : Map: Load *, ApplyMap('make-to-id', make, ID) as new_id Resident table"

Script:

DealerProfiling:
LOAD
ID,
Country,
make,
dealer
FROM [lib://AttachedFiles/DealerProfiling.xlsx]
(ooxml, embedded labels, table is Sheet3);


Mapping:
Mapping LOAD
make,
ID
;

Map:
Load
*,
ApplyMap('make-to-id', make, ID) as new_id
Resident table;

Labels (5)
1 Solution

Accepted Solutions
MayilVahanan

Nice to hear that, could you close this thread

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

9 Replies
settu_periasamy
Master III
Master III

Hi,

Can you the check the Mapping table name used in Apply map?

I think, it should be 'Mapping' instead of 'make-to-id'

ApplyMap('Mapping', make, ID) as new_id

 

 

Diego_780
Creator
Creator

Hi Nolgath,

The error is right, there is no make-to-id mapping in your script, the way Mapping sintaxis works is:

ApplyMap('map_name', expression [ , default_mapping ] )

 The name of YOUR map is Mapping, because that´s how you named that mapping table.

So if in your ApplyMap you put: ApplyMap('Mapping', make, ID) as new_id, this should work, but if you wan´t to use the 'make-to-id' as your mapping title, you should change the Mapping table title:

 

make-to-id:
Mapping LOAD
make,
ID
;

Map:
Load
*,
ApplyMap('make-to-id', make, ID) as new_id
Resident table;

Still, if you still have doubts, visit the documentation:

https://help.qlik.com/en-US/sense/May2022/Subsystems/Hub/Content/Sense_Hub/Scripting/MappingFunction...

 

Nolgath
Creator
Creator
Author

I did that and I get this error : 

The following error occurred:
ApplyMap error: map_id not found
 
The error occurred here:
Map: Load *, ApplyMap('map1', make, ID) as new_id Resident table
 
The following error occurred:
ApplyMap error: map_id not found.
 
My script now is: 

map1:
Mapping LOAD
make,
ID
;

Map:
Load
*,
ApplyMap('map1', make, ID) as new_id
Resident table;

Diego_780
Creator
Creator

Oh, I think you are not referring correctly with Resident table, you should Resident the table title as well, so:

DealerProfiling
LOAD
ID,
Country,
make,
dealer
FROM [lib://AttachedFiles/DealerProfiling.xlsx]
(ooxml, embedded labels, table is Sheet3);

map1:
Mapping LOAD
make,
ID
;

Map:
Load
*,
ApplyMap('map1', make, ID) as new_id
Resident DealerProfiling; // change the Resident table to your actual table name

MayilVahanan

Hi

What is the source for the mapping table? Its looks like you are using preceding table.

Can you post the script exactly what you are using?

My script now is: 

map1:
Mapping LOAD
make,
ID
; <--- source for this table?

Map:
Load
*,
ApplyMap('map1', make, ID) as new_id
Resident table;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Nolgath
Creator
Creator
Author

It is still giving me this error when I load data:

The following error occurred:
ApplyMap error: map_id not found
 
The error occurred here:
Map: Load *, ApplyMap('map1', make, ID) as new_id Resident DealerProfiling
 
The following error occurred:
ApplyMap error: map_id not found

 

Nolgath
Creator
Creator
Author

oh wow... that solved it! Thanks!

Diego_780
Creator
Creator

MayilVahanan is right, you still dont´have the source of the mapping table, so you are trying to map from nothing, I'm assuming by the fields you are trying to map from the first table, so:

DealerProfiling
LOAD
ID,
Country,
make,
dealer
FROM [lib://AttachedFiles/DealerProfiling.xlsx]
(ooxml, embedded labels, table is Sheet3);

map1:
Mapping LOAD
make,
ID
Resident DealerProfiling;

Map:
Load
*,
ApplyMap('map1', make, ID) as new_id
Resident DealerProfiling; // change the Resident table to your actual table name

MayilVahanan

Nice to hear that, could you close this thread

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.