Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

MarcoWedel
Not applicable

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

Re: ApplyMap issue?

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

3 Replies
Not applicable

Re: ApplyMap issue?

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
Not applicable

Re: ApplyMap issue?

*FACEPALM*

thanks, Darek

Regards

Marco

Not applicable

Re: ApplyMap issue?

Marco,

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