Skip to content

Instantly share code, notes, and snippets.

@ralfbecher
Last active December 15, 2015 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralfbecher/5314805 to your computer and use it in GitHub Desktop.
Save ralfbecher/5314805 to your computer and use it in GitHub Desktop.
Strip HTML tags in field data during QlikView load using a mapping table and MapSubstring() function
Data:
LOAD RecNo() as RecNo, Field
FROM <your source file>;
HtmlTag_Map:
MAPPING LOAD DISTINCT '<' & TextBetween('<' & SubField(Field, '<', IterNo()),'<','>') & '>' as HtmlTag, '' as Substitute
Resident Data
While NOT IsNull(SubField(Field, '<', IterNo()));
JOIN(Data) LOAD RecNo, MapSubstring('HtmlTag_Map', Field) as Field_Cleansed
Resident Data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment