<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Replace %Hex with character in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573788#M680790</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a mapping table with all the substitutions and then use MapSubString().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Apr 2014 10:49:17 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2014-04-29T10:49:17Z</dc:date>
    <item>
      <title>Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573787#M680788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my source data I have a field that contains data which has %Hex characters in it, as per this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #993300;"&gt;&lt;SPAN style="color: #993300;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PCI20 - &lt;STRONG&gt;%C2%BF&lt;/STRONG&gt;El agente env&lt;STRONG&gt;%C3%AD&lt;/STRONG&gt;a la bolsa por la cinta antes de que se sirve la pr&lt;STRONG&gt;%C3%B3&lt;/STRONG&gt;xima pax&lt;/SPAN&gt;&lt;STRONG style="color: #993300;"&gt;%3F&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to is search the string for all the &lt;SPAN style="color: #993300;"&gt;&lt;EM&gt;%&lt;/EM&gt;&lt;/SPAN&gt; 's and for each one translate the next 2 characters to its printable character, as in replace the &lt;EM style="color: #993300;"&gt;&lt;STRONG&gt;%3F&lt;/STRONG&gt;&lt;/EM&gt; at the end with &lt;SPAN style="color: #993300;"&gt;&lt;EM&gt;?&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas as I am flummoxed as how to approach this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; Bill Markham&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 10:42:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573787#M680788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-29T10:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573788#M680790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a mapping table with all the substitutions and then use MapSubString().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 10:49:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573788#M680790</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-04-29T10:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573789#M680792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no Hex conversion that I know of but it could easily be created manually (as it never changes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would create a Hex conversion table and use the table in an ApplyMap for the lookup of the character sets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to parse the field into its constituent parts, I would use &lt;EM&gt;Substringcount&lt;/EM&gt; to get the number of "%"s and perform a loop through the "%" using &lt;EM&gt;subfield&lt;/EM&gt; to extract the Nth part of the array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps and sorry I do not have time to work it fully through&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 10:52:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573789#M680792</guid>
      <dc:creator>Roop</dc:creator>
      <dc:date>2014-04-29T10:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573790#M680794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan's approach is much simpler I think &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 10:54:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573790#M680794</guid>
      <dc:creator>Roop</dc:creator>
      <dc:date>2014-04-29T10:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573791#M680795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you can get a space as a value in an inline load, so I would do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapCodes:&lt;/P&gt;&lt;P&gt;Mapping LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; Code,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Replace(Value, '\*', ' ') As Value&lt;/P&gt;&lt;P&gt;Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;&amp;nbsp; Code, Value&lt;/P&gt;&lt;P&gt;&amp;nbsp; %20%, \*&lt;/P&gt;&lt;P&gt;&amp;nbsp; %27%, '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 10:59:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573791#M680795</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-04-29T10:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573792#M680797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how should your output will be ? ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 11:05:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573792#M680797</guid>
      <dc:creator>preminqlik</dc:creator>
      <dc:date>2014-04-29T11:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573793#M680799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or just create it as a file so that it does not require an inline load ......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 11:08:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573793#M680799</guid>
      <dc:creator>Roop</dc:creator>
      <dc:date>2014-04-29T11:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573794#M680800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Jonathan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your suggestion looks promising, but I do not know in advance what the hex codes will be.&amp;nbsp; The string comes from a language translation table, so the hex could any of the hex codes for characters not on a standard UK English keyboard. Initially just Spanish language, but later many more languages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I reckon the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MapSubString()&lt;/SPAN&gt; you suggested is going to be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But also i have found this using my friend Google:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;=chr(Num#('&lt;SPAN style="color: #993300;"&gt;&lt;STRONG&gt;3F&lt;/STRONG&gt;&lt;/SPAN&gt;', '(HEX)'))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt; which from hex &lt;STRONG style="color: #993300;"&gt;3F&lt;/STRONG&gt; returns it printable character ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I just need to somehow mash this up into something workable.&amp;nbsp; [Maybe some cunning dollar expansion?]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Bill&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 11:22:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573794#M680800</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-29T11:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573795#M680801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your encoding is UTF-8, you should be able to automatically load all the mappings using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapAsciiCodes:&lt;/P&gt;&lt;P&gt;Mapping LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '%' &amp;amp; Num(RowNo() + 31, '(HEX)') As Code, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chr(RowNo() + 31) As Value&lt;/P&gt;&lt;P&gt;AutoGenerate 256 - 32;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that will have all the printable values up to %FF (0 - 31 are not printable)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 14:08:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573795#M680801</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-04-29T14:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Replace %Hex with character</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573796#M680802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Jonathan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for that cunning bit of script to autogenerate the Ascii Mapping Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is all looking very promising, so thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Bill&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 17:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-Hex-with-character/m-p/573796#M680802</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-29T17:15:33Z</dc:date>
    </item>
  </channel>
</rss>

