Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

HTML markup code

how to strip Html code from data field.

1 Solution

Accepted Solutions
everest226
Creator III
Creator III

Step 1: In your  extract QVW, add the below VB code under tools Edit module,

change Requested module security to system access and allow system access

Function stripHTML(strHTML)

'Strips the HTML tags from strHTML

  Dim objRegExp, strOutput

  Set objRegExp = New Regexp

  objRegExp.IgnoreCase = True

  objRegExp.Global = True

  objRegExp.Pattern = "<(.|\n)+?>"

  'Replace all HTML tag matches with the empty string

  strOutput = objRegExp.Replace(strHTML, "")

  'Replace all < and > with &lt; and &gt;

  strOutput = Replace(strOutput, "<", "&lt;")

  strOutput = Replace(strOutput, ">", "&gt;")

  stripHTML = strOutput    'Return the value of strOutput

  Set objRegExp = Nothing

End Function

Step 2: in edit script, after the field

replace(replace(stripHTML([content/properties/Your filed name])

        ,'&#58;',':')

        ,'&#160;',' ') as newcleanfiledname,

View solution in original post

2 Replies
everest226
Creator III
Creator III

Step 1: In your  extract QVW, add the below VB code under tools Edit module,

change Requested module security to system access and allow system access

Function stripHTML(strHTML)

'Strips the HTML tags from strHTML

  Dim objRegExp, strOutput

  Set objRegExp = New Regexp

  objRegExp.IgnoreCase = True

  objRegExp.Global = True

  objRegExp.Pattern = "<(.|\n)+?>"

  'Replace all HTML tag matches with the empty string

  strOutput = objRegExp.Replace(strHTML, "")

  'Replace all < and > with &lt; and &gt;

  strOutput = Replace(strOutput, "<", "&lt;")

  strOutput = Replace(strOutput, ">", "&gt;")

  stripHTML = strOutput    'Return the value of strOutput

  Set objRegExp = Nothing

End Function

Step 2: in edit script, after the field

replace(replace(stripHTML([content/properties/Your filed name])

        ,'&#58;',':')

        ,'&#160;',' ') as newcleanfiledname,

Not applicable
Author

Thanks everest226‌ is there anyway to do that in script