Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

what is wrong in my script?

Hello
I got a table called CASES_PEGA in which there is a field called PYDESCRIPTION which contains HTML tags
I'm trying to strip HTML codes and keep the text of PYDESCRIPTION field
I'm using the following script:

HtmlTag_Map:Mapping
LOAD DISTINCT
'<' & TextBetween('<' & SubField(PYDESCRIPTION, '<', IterNo()),'<','>') & '>' as HtmlTag,
'' as Substitute
Resident CASES_PEGA
While NOT IsNull(SubField(PYDESCRIPTION, '<', IterNo()));

Left Join(CASES_PEGA)
temp:
Load Distinct
CASE_ID
,MapSubstring('HtmlTag_Map', PYDESCRIPTION) as Field_Cleansed
Resident CASES_PEGA;

However I'm getting a GENERAL SCRIPT ERROR when executing the MapSubstring

kindly advise

I can walk on water when it freezes
14 Replies
ali_hijazi
Partner - Master II
Partner - Master II
Author

thank you @rwunderlich, and @sunny_talwar for your replies

So the problem is in the MapSubstring() function

the thing is that I posted the question in QlikView related space but I'm actually running this script in Qlik Sense so I cannot use the suggested alternative of writing a macro

Kindly advise

I can walk on water when it freezes
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You may be able to use the RexEx Connector https://help.qlik.com/en-US/connectors/Subsystems/Web_Connectors_help/Content/Connectors_QWC/Data-So... using the pattern I gave in the macro. 

-Rob

polisetti
Creator II
Creator II

Hi @sunny_talwar / @rwunderlich ,

Just wanted to check the alternative approach in the above case. I am facing the same issue and looking for another approach to remove all the HTML tags <> from a field. Could you please help me out????

Thanks,

Jaswanth P

Felipe_Violin
Contributor II
Contributor II

Rob, in your example you use the StripHtml function.

qlik sense does not exist this function,
do you know if there is an alternative?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You could use the RegEx connector with the replace function: https://help.qlik.com/en-US/connectors/Subsystems/Web_Connectors_help/Content/Connectors_QWC/Data-So...

-Rob