Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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 </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
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 </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
Hello
Thank you for your feedback.
I use Qlik Sense enterprise on windows
I used the Replace function which works
Thanks