Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

Re: Composite Key Issue with mapping Load

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;

View solution in original post

5 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Composite Key Issue with mapping Load

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

];

Highlighted

Re: Composite Key Issue with mapping Load

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;

View solution in original post

Highlighted
Master II
Master II

Re: Composite Key Issue with mapping Load

Thank you so much jagan and MayilVahanan.

Highlighted
Master II
Master II

Re: Composite Key Issue with mapping Load

Thank you jagan for correcting me where I was wrong.

Highlighted
Specialist
Specialist

Re: Composite Key Issue with mapping Load

You can try it



Data:

LOAD *,

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