Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
WEBINAR April 23, 2025: Iceberg Ahead: The Future of Open Lakehouses - REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
lea_ternat
Contributor II
Contributor II

Formating data in HTML

Hello, 

I'm extractgin an HTML text field from a database. Is there a function or API that would allow me to retrieve only the text without the tags and their contents ?

Thank you 

Léa 

Labels (4)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you are using Qlik SaaS, you can use one of the new Regex script functions like this:

HtmlClean:
LOAD
Html,
ReplaceRegEx(Html, '<\/?[a-z][a-z0-9]*[^<>]*>|<!--.*?-->', '') as HtmlText
Inline [
Html
<span><strong>Hello World</strong> Again</span>
<div class="col-3"><div class="kpi-card" onclick='showMetricChart(this.innerHTML, "metric-chart1")'>Monthly Churn</div></div>
<h4 style="display: inline-block"><span id="filteredCountLabel"></span> of <span id="totalCountLabel"></span> counties&nbsp;&nbsp;</h4>
] (delimiter is '|')
;

 

You could also likely use ExtractRegEx. I just happened to have the Replace example around. 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you are using Qlik SaaS, you can use one of the new Regex script functions like this:

HtmlClean:
LOAD
Html,
ReplaceRegEx(Html, '<\/?[a-z][a-z0-9]*[^<>]*>|<!--.*?-->', '') as HtmlText
Inline [
Html
<span><strong>Hello World</strong> Again</span>
<div class="col-3"><div class="kpi-card" onclick='showMetricChart(this.innerHTML, "metric-chart1")'>Monthly Churn</div></div>
<h4 style="display: inline-block"><span id="filteredCountLabel"></span> of <span id="totalCountLabel"></span> counties&nbsp;&nbsp;</h4>
] (delimiter is '|')
;

 

You could also likely use ExtractRegEx. I just happened to have the Replace example around. 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

lea_ternat
Contributor II
Contributor II
Author

Hello
Thank you for your feedback.
I use Qlik Sense enterprise on windows
I used the Replace function which works
Thanks