Discussion Board for collaboration related to QlikView App Development.
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](qvd);Speditör:LOAD %LIFNR, LFA1.Namn_SP, applymap('mapKUND',%LIFNR) AS [KUNNR] FROM$(QVD_Path_SD_EMB)Speditör_202_LFA1.QVD(qvd);
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?
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
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.
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]