Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Partner - Specialist
Partner - Specialist

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
Partner - Specialist II
Partner - Specialist II

Hi,

Please Find Attachement .Check this correct or not.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

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