<?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: Convert String to Hexadecimal Key in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084000#M636503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;If you are looking for this in a particular field, then AutoNumber() will do exactly what you are looking for&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Apr 2016 21:35:11 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-04-08T21:35:11Z</dc:date>
    <item>
      <title>Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1083999#M636502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm fairly new to qlik but from what I understand you can generate an integer key on a string by using autogenerate().&amp;nbsp; The problem as I understand is that using autogenerate() doesn't keep your key consistent necessarily.&amp;nbsp; For example using autogenerate(Products)&amp;nbsp; on Table A may not give you the same result as autogenerate(Products) on Table B because of the nature of data on each table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming I'm correct. (Big assumption)&amp;nbsp; &lt;/P&gt;&lt;P&gt;Can I have Qlikview generate a key that will always generate the same &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;exact&lt;/EM&gt;&lt;/SPAN&gt; key based on the string value?&amp;nbsp; For instance, if my Product is Apples how can I get Qlikview to always generate the same key value regardless of what qvd or table it is in?&amp;nbsp; I was thinking you could convert the string of "Apples" to hexadecimal or binary and then use that as the key?&amp;nbsp; Is that viable?&amp;nbsp; Has anyone done that?&amp;nbsp; Did you use a code in a module or is there a native qlikview command?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My real life example is this, I have a QVD X that has ToUSDExchangeRate, Trans Currency, Year, Month, Date.&amp;nbsp; And then I have QVD Y that has RecordID, Trans Currency, Charge, Year, Month, Date.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I was thinking I would add hex keys to both QVDs at time of QVD creation that represent the Date and Trans Currency concatenated.&amp;nbsp; It would enable me to link the 2 QVDs together easily whenever I need to.&amp;nbsp; I would prefer not linking on concatenated string fields..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your thoughts and ideas!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 20:44:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1083999#M636502</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-08T20:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084000#M636503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;If you are looking for this in a particular field, then AutoNumber() will do exactly what you are looking for&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 21:35:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084000#M636503</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-08T21:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084001#M636504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I meant autonumber() not autogenerate().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 21:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084001#M636504</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-08T21:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084002#M636505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look for them in QV Help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) &lt;A href="https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/CounterFunctions/autonumber.htm?q=Autonumber" title="https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/CounterFunctions/autonumber.htm?q=Autonumber"&gt;https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/CounterFunctions/autonumber.htm?q=Autonumb…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2) &lt;A href="https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/CounterFunctions/autonumberhash128.htm" title="https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/CounterFunctions/autonumberhash128.htm"&gt;https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/CounterFunctions/autonumberhash128.htm&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;3) &lt;A href="https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/CounterFunctions/autonumberhash256.htm" title="https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/CounterFunctions/autonumberhash256.htm"&gt;https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/CounterFunctions/autonumberhash256.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:14:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084002#M636505</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-08T22:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084003#M636506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know if I'm disagreeing or clarifying since you linked to the hash functions, but...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Autonumber() is specific to a single script. So assuming the two QVDs are being built by two different scripts, autonumber() will not produce the result we want. What WILL produce the result we want is autonumberhash128() or autonumberhash256(). Both of those create hash keys instead of consecutive integers. However, since those are creating 128 and 256-bit keys, I'm betting that concatenating the date and currency together will create a smaller key, and we shouldn't use either hash function for this specific case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: If the two QVDs are being built by the SAME script, then autonumber() will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Wait, what? AutonumberhashXXX() is ALSO specific to a single script? We have to use hashXXX()? Huh. Sorry. My mistake I guess.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:32:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084003#M636506</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-04-08T22:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084004#M636507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am glad that you are clarifying John. To tell you the truth, I have never used AutoNumberHash before and don't really understand the difference between the three options. I guess I need to get my basics right before helping others on this topic. But on the other hand, if I would not have commented, I would have never got the encouragement to learn something new. I apologize for mis-guiding the OP. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084004#M636507</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-08T22:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084005#M636508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and I was under the impression that both qvds were built in the same qvd generator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:37:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084005#M636508</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-08T22:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084006#M636509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So many edits John, stop confusing me &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:37:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084006#M636509</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-08T22:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084007#M636510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Except that it looks like I'm wrong as well. AutonumberhashXXX() is apparently specific to one script. So... what's the point of it? A straight autonumber() will give you a smaller key and work just fine for a single script. If we have to use hashXXX() to be dependent ONLY on the value we give it, in what situation would it ever be advantageous to use autonumberhashXXX()?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: More edits! I guess I should have researched before replying, but I thought I knew this one. The autonumberhashXXX() calculates a hash key... then assigns an integer to it. I still don't see the point of it, but now I don't see the point of it for a different reason - how is that any different from autonumber() except for being slower? Honestly, I've never used any of them. I fear making a mistake with autonumber() and accidentally using it across scripts somehow without realizing it, like if I convert a regular load into an incremental load, say, and autonumber() my incremental file before reading in the main file. And I've never had a case where I thought it was worth calculating a hash key. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 22:38:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084007#M636510</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-04-08T22:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084008#M636511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I like about the AutonumberHash() functions is that they are taking as many different fields/expressions as parameters as you like, so I don't have to worry about potential collisions when concatenating strings with similar values or delimiters that might occur in the data as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the same time I like Autonumber() for its ability to generate independent number series using its second parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Apr 2016 00:25:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084008#M636511</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-04-09T00:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084009#M636512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for not being clearer.&amp;nbsp; They are in 2 different scripts so autonumber won't necessarily give me the same result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 14:19:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084009#M636512</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-11T14:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084010#M636513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;Thanks for all your help!&lt;/P&gt;&lt;P&gt;I found this while looking around.&amp;nbsp; Would something like this work to always generate the same key based on the string value regardless of whether it's in the same script or not?&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #0f0f0f; font-size: 14px; font-family: 'Open Sans', Arial, sans-serif;"&gt;num#(mystringfield, '(HEX)' )&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 14:30:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084010#M636513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-11T14:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084011#M636514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;only if mystringfield contains hexadecimal (text-) values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 19:44:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084011#M636514</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-04-11T19:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084012#M636515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I ended up with guys.&amp;nbsp; It seems to work.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I added some vb code in the module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************************************************************************************&lt;/P&gt;&lt;P&gt;Function StringToHex(strInput) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For I = 1 To Len(strInput)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strTemp = Hex(Asc(Mid(strInput, I, 1)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Len(strTemp) = 1 Then strTemp = "0" &amp;amp; strTemp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strReturn = strReturn &amp;amp;&amp;nbsp; strTemp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringToHex = strReturn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;P&gt;**************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then I referenced it in the script like this:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;StringToHex(MyField1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if doing that is better or worse than just using a concatenated string field as a key, but it's another tool for the toolbox!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2016 15:58:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084012#M636515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-15T15:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to Hexadecimal Key</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084013#M636516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found out rather late about this discussion. We had it before (Rob and the gang) here.&lt;A href="https://community.qlik.com/thread/200904"&gt;Autonumber or Autonumber#&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess it all has to do with Symbol tables. I can't get a final grip on it yet (I agree that I stopped trying a while ago because of lack of time) but my intuition tells me that there is a big advantage to AutoNumberHashXXX() functions: &lt;EM&gt;they never store the actual string value in a symbol table&lt;/EM&gt;. Only useful for extremely large strings, which IMHO cause trouble in symbol tables. But that's the main part I still haven't got a good grip on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2016 17:40:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-String-to-Hexadecimal-Key/m-p/1084013#M636516</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-04-15T17:40:23Z</dc:date>
    </item>
  </channel>
</rss>

