Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
Nice to hear that, could you close this thread
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
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:
I did that and I get this error :
map1:
Mapping LOAD
make,
ID
;
Map:
Load
*,
ApplyMap('map1', make, ID) as new_id
Resident table;
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
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?
map1:
Mapping LOAD
make,
ID
; <--- source for this table?
Map:
Load
*,
ApplyMap('map1', make, ID) as new_id
Resident table;
It is still giving me this error when I load data:
oh wow... that solved it! Thanks!
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
Nice to hear that, could you close this thread