<?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 Converting str to hex in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900488#M313294</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am debugging a data issue and I need to find the way to convert strings into array of HEX values.&lt;/P&gt;&lt;P&gt;I do have a data set where some of the records contain few extra hidden characters (that's my guess).&lt;/P&gt;&lt;P&gt;&lt;IMG alt="all.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/92153_all.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;In the example above NUM values look the same, but actual length of the NUM string is different (7 characters for the first two records and 10 for the last two). &lt;/P&gt;&lt;P&gt;I've tried to use TRIM() function, but it did not help, so these extra characters are not "spaces". &lt;/P&gt;&lt;P&gt;Converting these strings to HASH values did not help either, all values are identical:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="hash.jpg" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/92154_hash.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Looks like these strings contain some characters that are ignored by normal string functions, but creating a problem for my data model since binary values of the NUM field are not identical for these records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would need some kind of String to HEX conversion to detect which characters exist in these records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will appreciate any advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vladimir &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jul 2015 17:54:29 GMT</pubDate>
    <dc:creator>vlad_komarov</dc:creator>
    <dc:date>2015-07-07T17:54:29Z</dc:date>
    <item>
      <title>Converting str to hex</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900488#M313294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am debugging a data issue and I need to find the way to convert strings into array of HEX values.&lt;/P&gt;&lt;P&gt;I do have a data set where some of the records contain few extra hidden characters (that's my guess).&lt;/P&gt;&lt;P&gt;&lt;IMG alt="all.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/92153_all.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;In the example above NUM values look the same, but actual length of the NUM string is different (7 characters for the first two records and 10 for the last two). &lt;/P&gt;&lt;P&gt;I've tried to use TRIM() function, but it did not help, so these extra characters are not "spaces". &lt;/P&gt;&lt;P&gt;Converting these strings to HASH values did not help either, all values are identical:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="hash.jpg" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/92154_hash.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Looks like these strings contain some characters that are ignored by normal string functions, but creating a problem for my data model since binary values of the NUM field are not identical for these records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would need some kind of String to HEX conversion to detect which characters exist in these records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will appreciate any advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vladimir &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 17:54:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900488#M313294</guid>
      <dc:creator>vlad_komarov</dc:creator>
      <dc:date>2015-07-07T17:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Converting str to hex</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900489#M313295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try doing this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;KeepChar(NUM, '0123456789') as NUM1&lt;/STRONG&gt; If NUM only contains numerical values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 17:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900489#M313295</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-07-07T17:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Converting str to hex</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900490#M313296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Need your sample data file in excel format !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 17:58:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900490#M313296</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-07-07T17:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Converting str to hex</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900491#M313297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny, &lt;/P&gt;&lt;P&gt;It works well for "normal" characters, but not in my case. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still returns the same string (NUM_HEX and &lt;SPAN style="font-size: 13.3333330154419px;"&gt;NUM_HEX_LEN are the new columns added&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="hash2.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/92157_hash2.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Vladimir &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 18:18:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900491#M313297</guid>
      <dc:creator>vlad_komarov</dc:creator>
      <dc:date>2015-07-07T18:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Converting str to hex</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900492#M313298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Ord() function could help you, but you will have to do it 1 character at a time.&amp;nbsp; Below pasted in from the Help :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor1287"&gt;&lt;/A&gt;&lt;A name="ord"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;&lt;EM&gt;ord( &lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class="Italic"&gt;s&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt; )&lt;/SPAN&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ASCII number of first character of string &lt;SPAN class="Italic"&gt;s&lt;/SPAN&gt;. The result is an integer. &lt;/EM&gt;&lt;/P&gt;&lt;P class="example"&gt;&lt;EM&gt;Example:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="Code"&gt;ord('A')&lt;/SPAN&gt; returns the number &lt;SPAN class="Italic"&gt;65&lt;/SPAN&gt;. &lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 18:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900492#M313298</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-07T18:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Converting str to hex</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900493#M313299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe it's a special char like chr(8203) which didn't react on most string-functions like trim() but a replace() or a keepchar() how suggested from &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;sunindia&lt;/A&gt; should work. Maybe you could make a loop on ord(mid(num, iterno(), 1) per while len(num) &amp;lt; iterno() to identify each char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 19:10:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900493#M313299</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-07-07T19:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Converting str to hex</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900494#M313300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want only debug you can use code like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;Chr(142)&amp;amp;1234 as String&lt;/P&gt;&lt;P&gt;autogenerate (1);&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;Chr(142)&amp;amp;123 as String&lt;/P&gt;&lt;P&gt;autogenerate (1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;max(len(String)) as lenght&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let convert = '';&lt;/P&gt;&lt;P&gt;for i=1 to peek('lenght',0,'C')&lt;/P&gt;&lt;P&gt;let convert =&amp;nbsp; convert&amp;amp;'&amp;amp;num(ord(mid(String,$(i),$(i)+1)),'&amp;amp;chr(39)&amp;amp;'(hex)00'&amp;amp;chr(39)&amp;amp;')';&lt;/P&gt;&lt;P&gt;next;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;left(''$(convert),len(String)*2) as hex&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 19:39:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900494#M313300</guid>
      <dc:creator>jonasheisterkam</dc:creator>
      <dc:date>2015-07-07T19:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Converting str to hex</title>
      <link>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900495#M313301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Jonas, &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Your code has worked perfectly. Thank you!&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;The interesting part is that it helped me realize that I've stepped into a known QV issue (&lt;A href="https://community.qlik.com/thread/58699"&gt;Leading 0 in Text field Qlikview transforms data incorrectly&lt;/A&gt;). So the problem was not with the special "hidden" characters, but simply with the way QV handles leading zeroes (the truncated NUM value for the case above was = 0000076115). &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thank you for your help!&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Regards,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Vladimir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 22:42:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Converting-str-to-hex/m-p/900495#M313301</guid>
      <dc:creator>vlad_komarov</dc:creator>
      <dc:date>2015-07-07T22:42:15Z</dc:date>
    </item>
  </channel>
</rss>

