Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to clean up data I'm getting from a forum db. The problem I'm having is that the body of the conversations include formatting tags. So in order to just leave the text parts I need to remove the tags. Fortunately all of the markup used is contained within < and >. How do I go about saying:
Clean(Field, Delete text from '<' to '>')
Is this possible?
E.g. the follow is what I currently have:
"anyone who has access to this forum should be on this list<br /><br /><br />Project Leader:<br /> Legacy<br /><br />Lead Artist:<br />"
and I want to just reduce it to "anyone who has access to this forum should be on this list Project leader: Lead Artist:"
UNLESS - there is a way to get Qlikview to actually use these tags and format these messages properly!
Thanks!
The following expression does what you want to do for the sample string:
Replace('<br /><br /><br />Project Leader:<br /> Legacy<br /><br />Lead Artist:<br />','<br />','')
For other tags, you may try a combination of TextBetween() and Replace() functions.
You may want to display the text in Stefan Walther's HTML2 extension.
QlikTip #39: Displaying Html content within QlikView (Minimalistic HtmlTextBox Object Extension)
If you don't want to use an extension, you can translate the tags as NagaianK suggested, but I would use MapSubstring for flexibility;
TagMap:
MAPPING
LOAD from, Evaluate(to) INLINE [
from, to
<br />, chr(10)
<p/>, chr(10)
]
;
Raw:
LOAD MapSubString('TagMap',Raw) as TranslatedText