# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
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

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
Highlighted
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
Highlighted
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

Highlighted
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).

Highlighted
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
Contributor II

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

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

Highlighted
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.