<?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>article Why should synthetic keys be removed from QlikView applications? in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Why-should-synthetic-keys-be-removed-from-QlikView-applications/ta-p/1711249</link>
    <description>&lt;P&gt;This example has the following conditions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Show the Total Sales during a period of time&lt;/LI&gt;
&lt;LI&gt;Show the Average Sales during a period of time&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;A straight table showing the results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sum of Sales Table.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55085i87470DAB5C365BF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sum of Sales Table.png" alt="Sum of Sales Table.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sum of Sales&amp;nbsp;&lt;/STRONG&gt;is showing the correct value 2+16+5+4+4+2+7+11=51&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Average Sales&lt;/STRONG&gt;&amp;nbsp; is showing 5,1 i.e. 51/10=5,1 and that seems to be correct according to the table above, but the value isn't correct based on the loaded data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Average Sales Script.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55086iC73A5A9DF8B166EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Average Sales Script.png" alt="Average Sales Script.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the source table&amp;nbsp;&lt;STRONG&gt;Transaction&lt;/STRONG&gt;&amp;nbsp;there are only 8 &lt;STRONG&gt;Sales&lt;/STRONG&gt; occurrences. Expected result for&amp;nbsp;&lt;STRONG&gt;Average Sales &lt;/STRONG&gt;is&amp;nbsp;51/8=6,375.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Resolution&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data model must be adjusted so that the two table only have one common field, which will resolve the synthetic key.&lt;BR /&gt;&lt;BR /&gt;In this case only the&amp;nbsp;field&amp;nbsp;&lt;STRONG&gt;SalesPerson&amp;nbsp;&lt;/STRONG&gt;in table&amp;nbsp;&lt;STRONG&gt;SalesPerson&lt;/STRONG&gt;&amp;nbsp;will be loaded. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LOAD SalesPerson.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55087iC1751AB84AEEEA11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LOAD SalesPerson.png" alt="LOAD SalesPerson.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The synthetic key is resolved and a new key created:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SalesPerson Syn keys.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55088i4434B8C796CF2A71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SalesPerson Syn keys.png" alt="SalesPerson Syn keys.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Both&amp;nbsp;&lt;STRONG&gt;Sum of Sales&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;Average Sales&lt;/STRONG&gt;&amp;nbsp;are now displaying the expected and correct values:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sum of Sales Table 2.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55089i48CA245420E49CE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sum of Sales Table 2.png" alt="Sum of Sales Table 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Synthetic keys aren't always the root cause when something goes wrong but it can be hard to foresee what the impact might be. Therefore, always make sure that synthetic keys are removed from the data model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Cause&lt;/H3&gt;
&lt;P&gt;The issue appears because of a synthetic key in the data model. The synthetic key is show as table named with &lt;STRONG&gt;$Syn&lt;/STRONG&gt; as prefix.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Syn Keys.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55090i93E4D9E825B1E18C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Syn Keys.png" alt="Syn Keys.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Two extra rows appear:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sum of Sales Table 3.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55091i6ACDDAF90EC8F9D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sum of Sales Table 3.png" alt="Sum of Sales Table 3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This happens because of the synthetic key and is a result of values found in table &lt;STRONG&gt;SalesPerson&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SalesPerson Syn keys 02.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55092iF9C8A5F964DE7DAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="SalesPerson Syn keys 02.png" alt="SalesPerson Syn keys 02.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2022 19:25:39 GMT</pubDate>
    <dc:creator>Sonja_Bauernfeind</dc:creator>
    <dc:date>2022-05-10T19:25:39Z</dc:date>
    <item>
      <title>Why should synthetic keys be removed from QlikView applications?</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Why-should-synthetic-keys-be-removed-from-QlikView-applications/ta-p/1711249</link>
      <description>&lt;P&gt;This example has the following conditions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Show the Total Sales during a period of time&lt;/LI&gt;
&lt;LI&gt;Show the Average Sales during a period of time&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;A straight table showing the results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sum of Sales Table.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55085i87470DAB5C365BF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sum of Sales Table.png" alt="Sum of Sales Table.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sum of Sales&amp;nbsp;&lt;/STRONG&gt;is showing the correct value 2+16+5+4+4+2+7+11=51&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Average Sales&lt;/STRONG&gt;&amp;nbsp; is showing 5,1 i.e. 51/10=5,1 and that seems to be correct according to the table above, but the value isn't correct based on the loaded data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Average Sales Script.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55086iC73A5A9DF8B166EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Average Sales Script.png" alt="Average Sales Script.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the source table&amp;nbsp;&lt;STRONG&gt;Transaction&lt;/STRONG&gt;&amp;nbsp;there are only 8 &lt;STRONG&gt;Sales&lt;/STRONG&gt; occurrences. Expected result for&amp;nbsp;&lt;STRONG&gt;Average Sales &lt;/STRONG&gt;is&amp;nbsp;51/8=6,375.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Resolution&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data model must be adjusted so that the two table only have one common field, which will resolve the synthetic key.&lt;BR /&gt;&lt;BR /&gt;In this case only the&amp;nbsp;field&amp;nbsp;&lt;STRONG&gt;SalesPerson&amp;nbsp;&lt;/STRONG&gt;in table&amp;nbsp;&lt;STRONG&gt;SalesPerson&lt;/STRONG&gt;&amp;nbsp;will be loaded. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LOAD SalesPerson.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55087iC1751AB84AEEEA11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LOAD SalesPerson.png" alt="LOAD SalesPerson.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The synthetic key is resolved and a new key created:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SalesPerson Syn keys.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55088i4434B8C796CF2A71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SalesPerson Syn keys.png" alt="SalesPerson Syn keys.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Both&amp;nbsp;&lt;STRONG&gt;Sum of Sales&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;Average Sales&lt;/STRONG&gt;&amp;nbsp;are now displaying the expected and correct values:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sum of Sales Table 2.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55089i48CA245420E49CE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sum of Sales Table 2.png" alt="Sum of Sales Table 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Synthetic keys aren't always the root cause when something goes wrong but it can be hard to foresee what the impact might be. Therefore, always make sure that synthetic keys are removed from the data model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Cause&lt;/H3&gt;
&lt;P&gt;The issue appears because of a synthetic key in the data model. The synthetic key is show as table named with &lt;STRONG&gt;$Syn&lt;/STRONG&gt; as prefix.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Syn Keys.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55090i93E4D9E825B1E18C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Syn Keys.png" alt="Syn Keys.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Two extra rows appear:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sum of Sales Table 3.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55091i6ACDDAF90EC8F9D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sum of Sales Table 3.png" alt="Sum of Sales Table 3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This happens because of the synthetic key and is a result of values found in table &lt;STRONG&gt;SalesPerson&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SalesPerson Syn keys 02.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55092iF9C8A5F964DE7DAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="SalesPerson Syn keys 02.png" alt="SalesPerson Syn keys 02.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 19:25:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Why-should-synthetic-keys-be-removed-from-QlikView-applications/ta-p/1711249</guid>
      <dc:creator>Sonja_Bauernfeind</dc:creator>
      <dc:date>2022-05-10T19:25:39Z</dc:date>
    </item>
  </channel>
</rss>

