Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewwizard
Master II
Master II

Composite Key Issue with mapping Load

Hi All,

I am facing mapping loading issue for the below script.

Please help to fix the issue.

MapCountry:

Mapping LOAD

[ID,Country

1,INDIA

2,Singapore

3,US

4,UK

5,Japan

];

Data:

LOAD *,

ApplyMap('MapCountry', ID) As Country,

ID & Name & Country As Key;

LOAD * inline [

ID,Name

1,A

2,B

3,C

4,D

5,E

6,F

7,G

8,H

9,I

10,J

];

EXIT Script;

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

MapCountry:

Mapping LOAD * Inline

[

ID,Country

1,INDIA

2,Singapore

3,US

4,UK

5,Japan

];

Data:

LOAD *,

ID & Name & Country As Key;

LOAD *, ApplyMap('MapCountry', ID, 'N/A') As Country inline [

ID,Name

1,A

2,B

3,C

4,D

5,E

6,F

7,G

8,H

9,I

10,J

];

 

EXIT Script;

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

5 Replies
jagan
Luminary Alumni
Luminary Alumni

HI,

Try this script

MapCountry:

Mapping LOAD

* INLINE     // You missed this line

[ID,Country

1,INDIA

2,Singapore

3,US

4,UK

5,Japan

];

Data:

LOAD

*,

ID & Name & Country As Key;   // Moved this line to 3rd precedent load.

LOAD *,

ApplyMap('MapCountry', ID) As Country;

LOAD * inline [

ID,Name

1,A

2,B

3,C

4,D

5,E

6,F

7,G

8,H

9,I

10,J

];

MayilVahanan

Hi

Try like this

MapCountry:

Mapping LOAD * Inline

[

ID,Country

1,INDIA

2,Singapore

3,US

4,UK

5,Japan

];

Data:

LOAD *,

ID & Name & Country As Key;

LOAD *, ApplyMap('MapCountry', ID, 'N/A') As Country inline [

ID,Name

1,A

2,B

3,C

4,D

5,E

6,F

7,G

8,H

9,I

10,J

];

 

EXIT Script;

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

Thank you so much jagan and MayilVahanan.

qlikviewwizard
Master II
Master II
Author

Thank you jagan for correcting me where I was wrong.

tyagishaila
Specialist
Specialist

You can try it



Data:

LOAD *,

ID & Name & ApplyMap('MapCountry', ID) As Key;