Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

kundan_sharma1
New Contributor III

In Mapping Load if there is no value against the key,So what will be returned for that key

For example

mapping table

Tab1:

key,Price

1,10

2,20

3,30

4,40

5,50

1,60

Tab2:

key,Name

1,A

2,B

3,C

4,D

5,E

6,F

above table shows mapping load

So, what will it return for key =1?........since there are two values for the key 1 in the first table

what will be the value for key =6?

Regards

Kundan Sharma

Tags (1)
1 Solution

Accepted Solutions
abhijith862
New Contributor III

Re: In Mapping Load if there is no value against the key,So what will be returned for that key

Mapping Load displays the value in the corresponding first field. So it will return the value for 1 as 10 and 6 will return the value as 6 as it will not find any corresponding value for 6

5 Replies
abhijith862
New Contributor III

Re: In Mapping Load if there is no value against the key,So what will be returned for that key

Mapping Load displays the value in the corresponding first field. So it will return the value for 1 as 10 and 6 will return the value as 6 as it will not find any corresponding value for 6

ben_pugh
Contributor

Re: In Mapping Load if there is no value against the key,So what will be returned for that key

applymap('mapname', expr [ , defaultexpr ] )

The value of the 'default expression' parameter is returned if there is no matching value.

If 'default expression' is omitted then the value is returned unchanged (i.e. is not mapped).

arvind1494
Valued Contributor

Re: In Mapping Load if there is no value against the key,So what will be returned for that key

for 1=10 and for 6=6

Highlighted
d_ankusha
Contributor II

Re: In Mapping Load if there is no value against the key,So what will be returned for that key

IN  mapping load ,

for key=1 the value returned will be 10 as the mapping load only give out the first matched value

for key=6 the value returned will be 6 i.e. the key value , as here there exist no value for key=6

jaumecf23
Contributor III

Re: In Mapping Load if there is no value against the key,So what will be returned for that key

Case Key 1 :

The applymap will return the value 10. From my experience, applymap returns the first field that it finds in the table. This behaviour could change and it's not a good idea to have repeated id's in the table.

Case Key 6 :

When the applymap is not able to find a solution, it returns the map_id value, in this case 6. I don't know if you know that you can introduce a default value to return when no match is found.