<?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 Incorrect Values - Double amounts due to Duplicate Values in Joining key in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2465501#M99184</link>
    <description>&lt;P&gt;Hi Experts,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have fact and dimension tables, I am trying to find the sum of a measure from my fact Table, but the result is incorrect due to duplicate values In my key (Dimension Table).&amp;nbsp; For Example, for some duplicate key combinations, it is summing the values twice hence I am getting inflated values.&amp;nbsp; To overcome this I have tried to use &lt;BR /&gt;1)distinct Keyword in the load script before joining dim Table&lt;BR /&gt;2)Sum(Distinct Amount), Sum - Aggr Combinations in the front end.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Unfortunately, I am still getting inflated values, Please let me know of any viable solution to overcome this.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2024 02:08:13 GMT</pubDate>
    <dc:creator>AjjuSid</dc:creator>
    <dc:date>2024-06-26T02:08:13Z</dc:date>
    <item>
      <title>Incorrect Values - Double amounts due to Duplicate Values in Joining key</title>
      <link>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2465501#M99184</link>
      <description>&lt;P&gt;Hi Experts,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have fact and dimension tables, I am trying to find the sum of a measure from my fact Table, but the result is incorrect due to duplicate values In my key (Dimension Table).&amp;nbsp; For Example, for some duplicate key combinations, it is summing the values twice hence I am getting inflated values.&amp;nbsp; To overcome this I have tried to use &lt;BR /&gt;1)distinct Keyword in the load script before joining dim Table&lt;BR /&gt;2)Sum(Distinct Amount), Sum - Aggr Combinations in the front end.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Unfortunately, I am still getting inflated values, Please let me know of any viable solution to overcome this.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 02:08:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2465501#M99184</guid>
      <dc:creator>AjjuSid</dc:creator>
      <dc:date>2024-06-26T02:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Values - Double amounts due to Duplicate Values in Joining key</title>
      <link>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2465503#M99185</link>
      <description>&lt;P&gt;Distinct will work only if entire record is duplicated,then you will get one entry&lt;/P&gt;
&lt;P&gt;Can you post some sample data&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 02:26:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2465503#M99185</guid>
      <dc:creator>anat</dc:creator>
      <dc:date>2024-06-26T02:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Values - Double amounts due to Duplicate Values in Joining key</title>
      <link>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2465506#M99187</link>
      <description>&lt;P&gt;I got it, Thanks for the clarification.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please find the sample dummy data.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Table 1&lt;/P&gt;
&lt;P&gt;AName&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BName&amp;nbsp; &amp;nbsp; Amount&lt;/P&gt;
&lt;P&gt;Abcde&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; kellog&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $100&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table 2&lt;/P&gt;
&lt;P&gt;AName&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BName&amp;nbsp; &amp;nbsp; &amp;nbsp;Category&lt;/P&gt;
&lt;P&gt;Abcde&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Kellog&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AB&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Abcde&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Kellog&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CD&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Resulting Table&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;AName&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BName &amp;nbsp; &amp;nbsp; Category&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;amount&lt;/P&gt;
&lt;P&gt;Abcde&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Kellog&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AB &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $100&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Abcde&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Kellog&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CD &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$100&lt;BR /&gt;&lt;BR /&gt;This is sample data, Please let me know if this works&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 02:49:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2465506#M99187</guid>
      <dc:creator>AjjuSid</dc:creator>
      <dc:date>2024-06-26T02:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Values - Double amounts due to Duplicate Values in Joining key</title>
      <link>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2465528#M99188</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/149111"&gt;@AjjuSid&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;To make your life easier, I do not recommend joining the tables in this case. This is what is causing your problems. It is fine to keep them separated. However, you still have a problem: the Synthetic Key. To solve that, you can create a composed key. Example:&lt;/P&gt;
&lt;PRE&gt;Fact:
LOAD 
    Hash128(AName,BName) AS %DimensionKey,
    Amount
INLINE [
AName, BName, Amount
Abcde, Kellog, $100
];
 
Dimension:
LOAD 
    Hash128(AName,BName) AS %DimensionKey,
    AName,
    BName,
    Category
INLINE [
AName, BName, Category
Abcde, Kellog, AB
Abcde, Kellog, CD
];

Autonumber '%*';
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Your data model will look like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marksouzacosta_0-1719374378324.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/168476iA4BA1C8A07287A1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marksouzacosta_0-1719374378324.png" alt="marksouzacosta_0-1719374378324.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note: I have added Hash128 and the AutoNumber statement at the end of the code just to show a better way to create composed keys in Qlik Sense. You can achieve the same result in many different ways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 04:13:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2465528#M99188</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-06-26T04:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Values - Double amounts due to Duplicate Values in Joining key</title>
      <link>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2466239#M99239</link>
      <description>&lt;P&gt;Thanks a lot for the help! It works for me&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 04:32:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incorrect-Values-Double-amounts-due-to-Duplicate-Values-in/m-p/2466239#M99239</guid>
      <dc:creator>AjjuSid</dc:creator>
      <dc:date>2024-06-28T04:32:36Z</dc:date>
    </item>
  </channel>
</rss>

