<?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 Composite Key Creation Error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766661#M663642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having a problem while creating a composite (or compound) key of 3 fields, concatenate using dashes. I use the key as a lookup field to assign user defined codes to a dataset using ApplyMap(). Depending on the order of the operation, the resulting key is calculated incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As shown below, if I concatenate the Code1, Code2 and Code3 using dashes, I get some strange, and incorrect, results. When I concatenate Code3, Code2 and Code 1, it gives the correct composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the concatenation to use something other than dashes, it seems to work. Does anyone know why this happens?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll attach the qvd and qvw for your testing pleasure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arnie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Jan 2015 02:12:50 GMT</pubDate>
    <dc:creator>arniewolff</dc:creator>
    <dc:date>2015-01-10T02:12:50Z</dc:date>
    <item>
      <title>Composite Key Creation Error</title>
      <link>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766661#M663642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having a problem while creating a composite (or compound) key of 3 fields, concatenate using dashes. I use the key as a lookup field to assign user defined codes to a dataset using ApplyMap(). Depending on the order of the operation, the resulting key is calculated incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As shown below, if I concatenate the Code1, Code2 and Code3 using dashes, I get some strange, and incorrect, results. When I concatenate Code3, Code2 and Code 1, it gives the correct composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the concatenation to use something other than dashes, it seems to work. Does anyone know why this happens?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll attach the qvd and qvw for your testing pleasure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arnie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 02:12:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766661#M663642</guid>
      <dc:creator>arniewolff</dc:creator>
      <dc:date>2015-01-10T02:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Key Creation Error</title>
      <link>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766662#M663643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a sample screen shot.&lt;IMG alt="Composite Key.JPG" class="image-1 jive-image" src="/legacyfs/online/75028_Composite Key.JPG" style="width: 620px; height: 78px;" /&gt;&lt;/P&gt;&lt;P&gt;Arnie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 02:14:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766662#M663643</guid>
      <dc:creator>arniewolff</dc:creator>
      <dc:date>2015-01-10T02:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Key Creation Error</title>
      <link>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766663#M663644</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;The values are concatenated correctly right?&amp;nbsp; What is your expected output?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 04:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766663#M663644</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-01-10T04:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Key Creation Error</title>
      <link>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766664#M663645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your concatenated key composite1 is treated as date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_147966_Pic1.JPG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75036_QlikCommunity_Thread_147966_Pic1.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another possibility to create a key out of those 3 fields would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14208868545547924 jive_macro_code" jivemacro_uid="_14208868545547924"&gt;
&lt;P&gt;AutoNumberHash128(Code1, Code2, Code3) as %Key&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&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, 10 Jan 2015 10:47:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766664#M663645</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-10T10:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Key Creation Error</title>
      <link>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766665#M663646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marco is right. When creating field values, for performance reasons QlikView will evaluate the pattern of the value and store it as a dual value. Things like &lt;SPAN style="font-family: courier new,courier;"&gt;xx-xx-xx&lt;/SPAN&gt; are recognized as dates, purely on the layout. The actual values may be illegal, but that doesn't matter. A value of 41-09-05 will be stored as a numerical value (the calculated date in days since the epoch) and the first string value that leads to the same numerical value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This becomes very bizarre when storing keys that look like time values. For example when storing 00:01:00 as a key value, a &lt;SPAN style="font-family: courier new,courier;"&gt;dual(1/(24*60), '00:01:00')&lt;/SPAN&gt; will be stored in the field's internal symbol table. If later on a new key value 00:00:60 is stored in this field, its dual value will not be &lt;SPAN style="font-family: courier new,courier;"&gt;(1/(24*60), '00:00:60')&lt;/SPAN&gt; but &lt;SPAN style="font-family: courier new,courier;"&gt;(1/(24*60), '00:01:00')&lt;/SPAN&gt; because the numerical value was already present in the symbol table. 1 minute (good data) and 60 seconds (bad data) lead to the same numerical time value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When creating key values, use whatever characters you like except those that are used in the various special formats (dots, commas, hyphens, semicolons and the likes). I always use the vertical bar &lt;SPAN style="font-family: courier new,courier;"&gt;|&lt;/SPAN&gt; as a key character, or I prefix keys with an alphabetic identifier (when I want to know what their source is, like &lt;SPAN style="font-family: courier new,courier;"&gt;O&lt;/SPAN&gt; for orders, &lt;SPAN style="font-family: courier new,courier;"&gt;I&lt;/SPAN&gt; for invoices, &lt;SPAN style="font-family: courier new,courier;"&gt;Q&lt;/SPAN&gt; for quotes etc.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 12:38:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766665#M663646</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-01-10T12:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Key Creation Error</title>
      <link>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766666#M663647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another solution could be to load explicitly as text:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14209382040542852 jive_macro_code" jivemacro_uid="_14209382040542852"&gt;
&lt;P&gt;load&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text(Code1&amp;amp;'-'&amp;amp;Code2&amp;amp;'-'&amp;amp;Code3) as Composite1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text(Code3&amp;amp;'-'&amp;amp;Code2&amp;amp;'-'&amp;amp;Code1) as Composite2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code3&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM &lt;/SPAN&gt;&lt;A class="" data-containerid="-1" data-containertype="-1" data-objectid="144572" data-objecttype="13" href="http://community.qlik.com/servlet/JiveServlet/download/2061-147966-692610-144572/UserCodes.qvd"&gt;http://community.qlik.com/servlet/JiveServlet/download/692610-144572/UserCodes.qvd&lt;/A&gt;&lt;SPAN&gt; (qvd);&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_147966_Pic3.JPG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75052_QlikCommunity_Thread_147966_Pic3.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&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>Sun, 11 Jan 2015 01:05:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766666#M663647</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-11T01:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Key Creation Error</title>
      <link>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766667#M663648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see attachment&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>Sun, 11 Jan 2015 01:07:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Composite-Key-Creation-Error/m-p/766667#M663648</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-11T01:07:00Z</dc:date>
    </item>
  </channel>
</rss>

