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: 
mohan2391
Creator III
Creator III

Remove the characters

Hi,

I have a field with values as below

<div class="ExternalClassA912479D552541668AD7097708527483">Orders &amp; Shipments</div>

In this, i wanted to remove the characters which are all existed in between < >

That means, for the above value i need

Orders &amp; Shipments

only.

Few more values ::

<div class="ExternalClass97B6256A295C43DF98B54A852E644B1E"><html>   <div class="ExternalClassD1A3669AB4B8494E860ED52F60A4F5AC">Orders &amp; Shipments</div> </html></div>

<div class="ExternalClass06D57CDFE8344AE9A95A9D9E3C238F30">Order data</div>

How can i remove ?

1 Solution

Accepted Solutions
devarasu07
Master II
Master II

Hi,

Like this?

Temp:

load * Inline [

Field

<div class="ExternalClassA912479D552541668AD7097708527483">Orders &amp; Shipments</div>

<div class="ExternalClass06D57CDFE8344AE9A95A9D9E3C238F30">Order data</div>

];

Data: 

LOAD RecNo() as RecNo, Field 

Resident Temp; 

Drop Table Temp;

 

HtmlTag_Map: 

MAPPING LOAD DISTINCT '<' & TextBetween('<' & SubField(Field, '<'),'<','>') & '>' as HtmlTag, '' as Substitute 

Resident Data; 

 

JOIN(Data) LOAD RecNo, MapSubstring('HtmlTag_Map', Field) as Field_Cleansed 

Resident Data; 

FYI,

Capture.JPG

View solution in original post

4 Replies
devarasu07
Master II
Master II

Hi,

Like this?

Temp:

load * Inline [

Field

<div class="ExternalClassA912479D552541668AD7097708527483">Orders &amp; Shipments</div>

<div class="ExternalClass06D57CDFE8344AE9A95A9D9E3C238F30">Order data</div>

];

Data: 

LOAD RecNo() as RecNo, Field 

Resident Temp; 

Drop Table Temp;

 

HtmlTag_Map: 

MAPPING LOAD DISTINCT '<' & TextBetween('<' & SubField(Field, '<'),'<','>') & '>' as HtmlTag, '' as Substitute 

Resident Data; 

 

JOIN(Data) LOAD RecNo, MapSubstring('HtmlTag_Map', Field) as Field_Cleansed 

Resident Data; 

FYI,

Capture.JPG

ahaahaaha
Partner - Master
Partner - Master

Hi,

May be like this (look attached file)

Expression:

'Order'&TextBetween(Field, 'Order', '<')

Regards,

Andrey

Anil_Babu_Samineni

What you do if you have something like below

<div class="ExternalClassA912479D552541668AD7097708527483">Sample Welcome Orders &amp; Shipments</div>


May be this?

=TextBetween(FieldName, '>', '<')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
mohan2391
Creator III
Creator III
Author

Hi,

It's working fine but is giving all the values which start with ORDER only.

But in my field values are starting with different names not with a few fixed words

Thanks for the support.