Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Replace String in another String

Hi Everyone,

I need to replace a string to another string, for example:

1) Pippo Franco

2) Pippo Franco/Ciccio Pasticcio

3)Pippo Franco/Pappa Pippo

....

I'd like to replace only the frank pippo string, leaving the remainder unchanged.

For example:

1)Pluto Topolino

2) Pluto Topolino/Ciccio Pasticcio

3)Pluto Topolino/Pappa Pippo

.....

Thanks,

Livio

1 Solution

Accepted Solutions
Highlighted

May be this

Replace(FieldName, 'Pippo Franco', 'Pluto Topolino') as FieldName

View solution in original post

5 Replies
Highlighted
Creator II
Creator II

Hi,

     Please try Replace() :-

Ex:-

Replace('abccde','cc','xyz') returns 'abxyzde'

Load

Replace(FieldName,'TEST','123') as  RepField

From location;

Highlighted

May be this

Replace(FieldName, 'Pippo Franco', 'Pluto Topolino') as FieldName

View solution in original post

Highlighted

You can also look into using MapSubString in the script

Highlighted
Specialist III
Specialist III

You can use replace function

Replace(FieldName, What to be replaced, with what)

in your case for eg with hardcoded values

Replace('Pippo Franco/Ciccio Pasticcio','Pippo Franco',Pluto Topolino')

HTH

Highlighted
Creator
Creator

Use Replace(text, from_str, to_str)

Replace('Pippo Franco','Pippo Franco','Pluto Topolino')

Replace('Pippo Franco/Ciccio Pasticcio','Pippo Franco','Pluto Topolino')

Replace('Pippo Franco/Pappa Pippo','Pippo Franco','Pluto Topolino')


In Script:

Capture.JPG

Replace(text field name, from_str, to_str)

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/StringFunction...