Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Applymap missmatch ?

Dear Sirs,

I have coding in the script below.

mapKUND:Mapping LOAD %LIFNR,
text(replace(ltrim(replace(KNVP.KUNNR, '0', ' ')), ' ', 0)) as KNVP.KUNNR FROM
[..\..\..\..\Source Data\QVD\SAP\EMB\Marknad\SPEDITÖR_202_KNVP.QVD]

Speditör:LOAD %LIFNR,
applymap('mapKUND',%LIFNR) AS [KUNNR]

The result in the table is:

%LIFNR          LFA1.Namn_SP     KUNNR

0001043199      Schenker          0001043199

The result I really want is that KUNNR should display value from KNVP.KUNNR = Customer number in order.

Could anyone please help me?

Regards Magnus

3 Replies
Esteemed Contributor

Re: Applymap missmatch ?

your code looks right to me.

please check result of below code

text(replace(ltrim(replace(KNVP.KUNNR, '0', ' ')), ' ', 0)) as KNVP.KUNNR

weither its calculating correct

the result depend on the above calculaton.

or you can share sample file

hope this help


Applymap missmatch ?

Hi Magnus,

It looks like that the %LIFNR don't have the same format or something.

I say this because the KUNNR get's the %LIFNR when there's no match and you don't have a default expression on the applymap.

You should always use a default expression (even null() is more usefull than nothing).

My advice is load the mapping table without the mapping to check what

text(replace(ltrim(replace(KNVP.KUNNR, '0', ' ')), ' ', 0))

is returning and if %LIFNR have the same format.



Not applicable

Re: Applymap missmatch ?

Hi Carlos,

Sorry for the late reply. You where correct.  I needed to ad the same trim function as KUNNR in order to trim the leading zeros.


(replace(ltrim(replace(%LIFNR, '0', ' ')), ' ', 0)) as [%LIFNR]

Regards Magnus