Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community,
creating a script to solve thread 114112, I experienced an issue with the ApplyMap function:
FieldMap:
Mapping LOAD * Inline [
0, <none>
1, COUNTRY
2, YEAR
3, BRAND
4, Model
5, Contidion
6, Delivered
];
tabOutput:
Generic LOAD
%RecordID,
ApplyMap('FieldMap', IterNo()),
SubField(SubSTR, '|', IterNo())
While IterNo() <= SubStringCount(SubSTR, '|')+1;
LOAD
AutoNumberHash128(COUNTR, SubSTR) as %RecordID,
COUNTR&'|'&SubSTR as SubSTR
Where Len(SubSTR)>0;
LOAD COUNTRY as COUNTR, SubField(STR, '~~') as SubSTR
FROM [http://community.qlik.com/servlet/JiveServlet/download/507618-101744/Sample%20file%20for%20test.xlsx]
(ooxml, embedded labels, table is INPUT);
The ApplyMap didn't work for value 1 (COUNTRY) unless I added a value 0 in the mapping load.
(To reproduce just delete row "0, <none>" in the mapping load)
Any ideas why ApplyMap behaves like this?
thanks
regards
Marco
Marco,
dont you need field names in inline?
Like:
FieldMap:
Mapping LOAD * Inline [
id, field_name
1, COUNTRY
2, YEAR
3, BRAND
4, Model
5, Contidion
6, Delivered
];
anyway ... nice script
regards
Darek
Marco,
dont you need field names in inline?
Like:
FieldMap:
Mapping LOAD * Inline [
id, field_name
1, COUNTRY
2, YEAR
3, BRAND
4, Model
5, Contidion
6, Delivered
];
anyway ... nice script
regards
Darek
*FACEPALM*
thanks, Darek
Regards
Marco
Marco,
most important is, that you, as usual, found solution (using additional row) .......