Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
MarcoWedel

ApplyMap issue?

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

1 Solution

Accepted Solutions
Not applicable

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

View solution in original post

3 Replies
Not applicable

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

MarcoWedel
Author

*FACEPALM*

thanks, Darek

Regards

Marco

Not applicable

Marco,

most important is, that you, as usual, found solution (using additional row) .......