Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
There are some examples using regular expressions in this forum that might do the trick.
There are some examples using regular expressions in this forum that might do the trick.
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.
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