Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

simotrab
Contributor II

Mapping and & operator

Hi community,

I'm working with the Mapping group of features, and I've found a small problem that I'd like to solve, maybe helping pointing out it.

Hovever, here the situation: I have this table, that has clearly a pair of mistakes.

LOAD

Label.Key,

Label.Key&Name

Inline

[Label.Key, Name

'A','first'

'FI','second'

'CP','third'

'RM','fourth'

And the red Label occurency are wrong, so I decided to remove them and adding the right Labels with a mapping (applied before the table):

Mapping:

Mapping Load Old, New Inline

[Old, New,

'CP', 'NS'

'FI', 'NS'

'RM', 'NS'

];

MAP Label.Key Using Mapping;

Unluckily the result is not perfect, because the mapping maps only the field Label.Key without mapping Label.Key&Name.

mapping.PNG

I'd like also the Label.Key part of the Label.Key&Name mapped.


I've tried something like:

LOAD

Label.Key,

Applymap(Mapping, Old, Label.Key)&Name

Inline

[Label.Key, Name

'A','first'

'FI','second'

'CP','third'

'RM','fourth'

]

But I got an error that says:

ApplyMap error: map_id not found

How could I make it work?


Thanks in advance

Tags (1)
1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: Mapping and & operator

Hi Simone,

may be

LOAD *,ApplyMap('Mapping',Label.Key)&Name  as NewName Inline [
Label.Key, Name
'A','first'
'FI','second'
'CP','third'
'RM','fourth'
]
;

Regards,

Antonio

2 Replies
antoniotiman
Honored Contributor III

Re: Mapping and & operator

Hi Simone,

may be

LOAD *,ApplyMap('Mapping',Label.Key)&Name  as NewName Inline [
Label.Key, Name
'A','first'
'FI','second'
'CP','third'
'RM','fourth'
]
;

Regards,

Antonio

simotrab
Contributor II

Re: Mapping and & operator

Grazie Antonio,

that's the right answer.

Community Browser