Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Cleaning up a data string with < > delimeters

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!

2 Replies
nagaiank
Valued Contributor III

Re: Cleaning up a data string with < > delimeters

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.

Re: Cleaning up a data string with < > delimeters

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

Community Browser