Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replace function not working. Please help?


Hi,

I am trying to replace below in script. But it is showing error

  Replace(Lead,'Adam O'Balson','Adam O Balson') as Lead

Is there any wrong in above expression?

Thanks.

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

This should be working as you can see in the attached example, maybe there is something else wrong. What is the error? Otherwise please share a qvw which demonstrates the problem.

View solution in original post

10 Replies
stigchel
Partner - Master
Partner - Master

Try With

=Replace(Lead,'Adam O'&Chr(39)&'Balson','Adam O Balson')

Not applicable
Author

Thanks. tried this not working. Any solution please

stigchel
Partner - Master
Partner - Master

This should be working as you can see in the attached example, maybe there is something else wrong. What is the error? Otherwise please share a qvw which demonstrates the problem.

sunny_talwar

Why not try this instead:

=Replace(Lead, Chr(39), ' ')

Best,

Sunny

PrashantSangle

Hi,

Use PurgeChar()

try like PurgeChar(FieldName,Chr(39))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Thanks. It's working now. How can I change the same expression if I want to keep 'Adam O'Balson'

I have one more requirement to use in pivot chart expression as below. when I am using this it is showing error

If(Match(Lead,'Mitchet','Sony', 'Adam O'Balson'),Lead)


stigchel
Partner - Master
Partner - Master

It's the same problem as ' is used by qlikview as text delimiter. Same solution:

If(Match(Lead,'Mitchet','Sony', 'Adam O'&Chr(39)&'Balson'),Lead)

jonathandienst
Partner - Champion III
Partner - Champion III

This works in 11.2 SR9 (two single apostrophes):

If(Match(Lead, 'Mitchet', 'Sony', 'Adam O''Balson'), Lead)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks.