Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Wildcard in replace

Hi.

 

I am scraping some data from a website and then cleaning it in QlikView. Some of the fields include text like "1 person found this review helpful", which I want to strip. Below is what I am currently doing in my load script, and it works, but the problems is that X number of people can find a review helpful, so to catch all the scenarios I would need to expand on this expression almost indefinitely.

 

replace(replace(replace(replace(
Purgechar(cons, chr(10)&chr(13)),
'HelpfulShareRepor',''),
'Be the first to find this review helpful',''),
'1 person found this review helpful',''),
'2 people found this review helpful','')
as cons,

 

So ideally I would want to use a wildcard character to replace that entire sentence, so that even if it says '9 people found this review helpful', I can still have it replaced. But the replace function doesn't take wildcards...

 

any ideas how I can achieve this?

 

Labels (2)
1 Solution

Accepted Solutions
MarcoWedel

There are some examples using regular expressions in this forum that might do the trick.

View solution in original post

3 Replies
MarcoWedel

There are some examples using regular expressions in this forum that might do the trick.

gerhardl
Creator II
Creator II
Author

I got a notification saying that I marked this response as the correct answer, although I did not. I do appreciate the feedback and I will go looking, but I'm a little disappointed that all I am getting is a "go look elsewhere" answer. For people trying to learn and collaborate, this forum is usually very approachable. 

MarcoWedel

Don't know how the post got marked as solution, but a quick search provided these links:

https://community.qlik.com/t5/QlikView-App-Dev/Replacing-Text-using-Wildcards/td-p/278923

https://community.qlik.com/t5/QlikView-App-Dev/Regular-expression-A-Z/td-p/851408

https://community.qlik.com/t5/QlikView-Documents/How-to-use-regular-expressions/ta-p/1477236

I think the RegExp.Replace example should work in your case as well.

hope this helps

Marco