Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Replace multiple strings altogether

I have this situation where I have to replace multiple strings with a single string value.
Information.replace("", "Resident Referral").
replace("", "Return Visitor");

Referral                 
Resident Referral
Resident Referrral -------------- Replace all three with Resident Referral
Return visitor
Return Visitor
Return Vistitor
Return Vistor ----------------- Replace all four with Return Visitor

Replace the string values where Refer is common with Resident Referral and replace the string values where Return is common with Return Visitor.
How can I get this done?
Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Hi,
In tMap (or tJavaRow), use replaceAll with according regex, something like:
row1.Information.replaceAll("^.*Refer.*$", "Resident Referal").replaceAll("^.*Return.*$", "Return Visitor")

Check the syntax but that's the idea.
Regards,
TRF

View solution in original post

1 Reply
TRF
Champion II
Champion II

Hi,
In tMap (or tJavaRow), use replaceAll with according regex, something like:
row1.Information.replaceAll("^.*Refer.*$", "Resident Referal").replaceAll("^.*Return.*$", "Return Visitor")

Check the syntax but that's the idea.
Regards,
TRF