Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to exclude all words that begins with @ or # from a field.
so eg.
"@handelsbanken @SVTPlus @Swedbank @Nordea_SE @SEBSverige papers klipp sökes @PrinsDanne alt hjälp täkt I http://t.co/zz4xGLy1BR I @dfjsteve"
would come out something like: "papers klipp sökes, alt hjälp täkt"
I have tried to use some regular expressions in the load statement:
eg.
"parse('\s(\@+w|\#+w)[\s$]', '', [Tweets], 1) as Tweets"
or
"regex1(Tweets,'@\w*\s') as Tweets"
But the script editor won't take parse or regex as a valid function. is there any way to get around this problem.
Some advanced settings that i have missed or something else?
Thankful for any help!
BR
/Pierre
Hi Pierre,
Here is my suggestion, Load the content using SubField() function to separate the message. Then Load again the table but this time, use a condition to remove all the words that start with '@' character and in the same load statement use concat() to rebuild the original message:
The first section of the code will generate a table like this one:
And the second part, after filtering and grouping you will get this output:
Hope it helps.
Best regards,
Karla
I see that you have the grasp of Regular Expressions so you should have a look at Barry Harmsen's blog about "Regular Expressions in the load script":
Google: qlikfix regular expression
And you find the tips you need I think.
HTH
- Petter
Thanks Karla,
since i heard that regular expressions needs a macro (and macros don't work very good in Ajax), i think i will go with with your suggestion.
thanks!
br
/Pierre