Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Find & Replace

Dear Sir,

We are having following type of records in our database under department fields. Now we want to replace this file with CSG and MKTG wherever text is appear as CSG and Marketing.

Ahmedabad  -CSG
Baroda -CSG
CSG -BVN
CSG -Kutch
Marketing -Baroda
Marketing -Rajkot
Surat -Marketing

Regards,

UMESH

3 Replies
vijay_iitkgp
Not applicable

Find & Replace

Hi If I understand correctly you want to replace Baroda-CSG with CSG and Marketing-Baroda with Marketing.

You can use substringcount function.

If(Substringcount(Field,'CSG')=1,'CSG',

If(SubstringCount(Field,'Marketing')=1,'Marketing',Field)) as aa

Hope this will help

perumal_41
Not applicable

Re: Find & Replace

Hi,

Please Find Attachement .Check this correct or not.

jason_michaelid
Not applicable

Find & Replace

Not exactly sure of your requirements so choose one of these in your load script:

LOAD

          Replace(Department,'Marketing','MKTG')          AS          Department

FROM

(ooxml, embedded labels, table is Sheet1);

OR

LOAD

  IF(Department='CSG and Marketing','CSG and MKTG',Department) AS Department

FROM

(ooxml, embedded labels, table is Sheet1);

Hope this helps,

Jason