Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

replacing the name in a table

Hi Experts,

i have the following table loaded from a qvd.

Target:

LOAD BDM,

     [Branch Name],

     LBDM,

     TGT_YEAR,

    

FROM

QVD\TGT_YEAR.qvd

(qvd);

in the LBDM field, i have a list of names.

i need to replace the name Nick by Chris.

how can i do that.

any script changes?

please help me in this regard.

1 Solution

Accepted Solutions
Partner
Partner

Re: replacing the name in a table

You can use the ApplyMap function (see help), something like this

MyMap:

mapping load * inline [From,To

'Nick','Chris'

];

Target:

LOAD BDM,

     [Branch Name],

     Applymap('MyMap',LBDM,LBDM) as LBDM,

     TGT_YEAR,

   

FROM

QVD\TGT_YEAR.qvd

(qvd);

5 Replies
Not applicable

Re: replacing the name in a table

Hi,

This could easy be solved by using Applymap on the LBDM field to replace "Nick" with "Chris".

Good luck!

Not applicable

Re: replacing the name in a table

can u pls help me with the script?

Partner
Partner

Re: replacing the name in a table

You can use the ApplyMap function (see help), something like this

MyMap:

mapping load * inline [From,To

'Nick','Chris'

];

Target:

LOAD BDM,

     [Branch Name],

     Applymap('MyMap',LBDM,LBDM) as LBDM,

     TGT_YEAR,

   

FROM

QVD\TGT_YEAR.qvd

(qvd);

puttemans
Valued Contributor

Re: replacing the name in a table

Map_Name:

MAPPING LOAD * Inline

[Name, Newname

Nick, Chris];

Target:

LOAD BDM,

     [Branch Name],

    Applymap('Map_Name', LBDM) as LBDM,

     TGT_YEAR,

   

FROM

QVD\TGT_YEAR.qvd

(qvd);

Re: replacing the name in a table


Hi,

If you want to replace only one name

then use if(wlidmatch(LBDM,'Nick'),'Chris',LBDM) as Ne_LBDM

else use ApplyName()

Regards

Great dreamer's dreams never fulfilled, they are always transcended.