Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
brf10043
Creator
Creator

Remove unwanted text from a String

I'm pulling data from a sharepoint list and some of the text has extra unwanted characters.

How would I remove ​"<span aria-hidden="true"></span>" from the string below

<span aria-hidden="true"></span>Lets all work 3 days a week

or

remove everything except "Lets all work 3 days a week" from the string below?

<div class="ExternalClass450FFA875469469B9098549F4A621B80"><p>​<span aria-hidden="true"></span>Lets all work 3 days a week</p></div>

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

The below works

EDITTEXT:

Mapping Load * inline [

From,to

>,@{

<,}@

];

LOAD

textbetween(Mapsubstring('EDITTEXT',replace(FIELDIS,'><','_')),'@{','}@') as FieldIS

;

LOAD if(Match(right(Trim(FIELDIS),1),'>')=0,FIELDIS&'<',FIELDIS) as FIELDIS inline [

FIELDIS

<div class="ExternalClass450FFA875469469B9098549F4A621B80"><p><span aria-hidden="true"></span>Lets all work 3 days a week</p></div>

<span aria-hidden="true"></span>Lets all work 3 days a week line 2 test

];

stripHTML.JPG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

16 Replies
devarasu07
Master II
Master II

temp:

LOAD * INLINE [

Field

<div class="ExternalClass450FFA875469469B9098549F4A621B80"><p><span aria-hidden="true"></span>Lets all work 3 days a week</p></div>

];

Fact:

Load stripHTML(Field) as FieldCleaned

Resident temp;

2.png

devarasu07
Master II
Master II

Hi,

Refer to the attachment,

2.png

vishsaggi
Champion III
Champion III

Try this

= Subfield(Subfield('<div class="ExternalClass450FFA875469469B9098549F4A621B80"><p><span aria-hidden="true"></span>Lets all work 3 days a week</p></div>', '</span>',2), '<')

vishsaggi
Champion III
Champion III

stripHTML() is this new function in V12.0 ?

brf10043
Creator
Creator
Author

Could be.  I can't get it to work in 11.

devarasu07
Master II
Master II

Hi,

nope, it's vbscript function

4GuysFromRolla.com

brf10043
Creator
Creator
Author

I'm not sure I follow this.  It appears that you are hardcoding this.  I can't predict what the text I want to keep will be.

"Lets all work 3 days a week" is just on of the entries.

brf10043
Creator
Creator
Author

The actual column is "ows_TO_x002d_BE"

devarasu07
Master II
Master II

Hi,

It's just vbscript only. it working fine in QV 11 also

try below steps,

1) in your qvw document. Press Ctrl+M (open macros windows)

2) try to do below settings and

2) 3.JPG