<?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 How calculate amount and remove duplicate ones in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232145#M83801</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I run into one question about how to sum amount.&lt;/P&gt;&lt;P&gt;I have used outer join connect 2 two tables into one.&lt;/P&gt;&lt;P&gt;OrderId Amount TypeID&lt;/P&gt;&lt;P&gt;1 $2 A&lt;/P&gt;&lt;P&gt;1 $2 A&lt;/P&gt;&lt;P&gt;1 $3 B&lt;/P&gt;&lt;P&gt;If I use sum(Amount) expression, then the results will be $7, but you can see row 2 should be removed, I just want to get $2+$3.&lt;/P&gt;&lt;P&gt;I would like some one to tell me I should use which expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Dec 2010 04:37:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-12-24T04:37:35Z</dc:date>
    <item>
      <title>How calculate amount and remove duplicate ones</title>
      <link>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232145#M83801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I run into one question about how to sum amount.&lt;/P&gt;&lt;P&gt;I have used outer join connect 2 two tables into one.&lt;/P&gt;&lt;P&gt;OrderId Amount TypeID&lt;/P&gt;&lt;P&gt;1 $2 A&lt;/P&gt;&lt;P&gt;1 $2 A&lt;/P&gt;&lt;P&gt;1 $3 B&lt;/P&gt;&lt;P&gt;If I use sum(Amount) expression, then the results will be $7, but you can see row 2 should be removed, I just want to get $2+$3.&lt;/P&gt;&lt;P&gt;I would like some one to tell me I should use which expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Dec 2010 04:37:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232145#M83801</guid>
      <dc:creator />
      <dc:date>2010-12-24T04:37:35Z</dc:date>
    </item>
    <item>
      <title>How calculate amount and remove duplicate ones</title>
      <link>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232146#M83802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Isaac,&lt;/P&gt;&lt;P&gt;Try this :&lt;/P&gt;&lt;P&gt;LOAD OrderID, Amount, TypeID&lt;/P&gt;&lt;P&gt;RESIDENT ...... WHERE NOT EXISTS (OrderID,Amount,TypeID);&lt;/P&gt;&lt;P&gt;regards, tresesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Dec 2010 05:49:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232146#M83802</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2010-12-24T05:49:37Z</dc:date>
    </item>
    <item>
      <title>How calculate amount and remove duplicate ones</title>
      <link>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232147#M83803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I think you should not join both the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can link the two tables based on the key field and expression will work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Dec 2010 07:26:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232147#M83803</guid>
      <dc:creator>deepakk</dc:creator>
      <dc:date>2010-12-24T07:26:57Z</dc:date>
    </item>
    <item>
      <title>How calculate amount and remove duplicate ones</title>
      <link>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232148#M83804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Deepak is right - if you join a details table to a header table, which it looks like you've done, you will get duplication of the totals.&lt;/P&gt;&lt;P&gt;Use &lt;B&gt;&lt;I&gt;keep&lt;/I&gt;&lt;/B&gt; rather than &lt;B&gt;&lt;I&gt;join&lt;/I&gt;&lt;/B&gt;, and you should get a better header - details data structure, and the results you're looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Dec 2010 08:32:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232148#M83804</guid>
      <dc:creator>colinh</dc:creator>
      <dc:date>2010-12-24T08:32:17Z</dc:date>
    </item>
    <item>
      <title>How calculate amount and remove duplicate ones</title>
      <link>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232149#M83805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If all the field of rows same with the existing one then you just Load the table with Distinct keyword, then it will take one distinct row. Means once the outer join completed then make a resident load of final table with ditinct load.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Dec 2010 11:52:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232149#M83805</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2010-12-24T11:52:46Z</dc:date>
    </item>
    <item>
      <title>How calculate amount and remove duplicate ones</title>
      <link>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232150#M83806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joining tables is always tricking especially when both the tables contain partial "Facts"!&lt;/P&gt;&lt;P&gt;I would interpret the case presented as under:&lt;/P&gt;&lt;P&gt;Fact1: Amount field belongs to the 'order detail' table and hence orderid may repeat for every line of items sold under one order.&lt;/P&gt;&lt;P&gt;Fact2: TypeID field belongs to the 'order header' table and "may" represent current status of the order given the business requirement. It is reasonable to assume that there could be a 'current status flag' to identify the orderid and the TypeID. This becomes a useful metric to analyse if the users wants to know how many times the "TypeID" changed for the order!&lt;/P&gt;&lt;P&gt;Recommendation:&lt;/P&gt;&lt;P&gt;1. I agree with Deepak. Do not join the table if the above 2 scenarios is true but only keep 'orderid' as a link field between the header and line table&lt;/P&gt;&lt;P&gt;2. If only the latest 'TypeID' is relevant, use the current status flag to reduce the header table to one unique row each orderid before jonining with the order details table&lt;/P&gt;&lt;P&gt;3 Exercise caution in using 'Distinct' - orderid can have two rows with 'same' amount but belonging to different items!&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Many times, there is nothing like a 'right solution', it all depends on how the users interprets their data - as facts and dimensions!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Dec 2010 07:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232150#M83806</guid>
      <dc:creator />
      <dc:date>2010-12-25T07:17:08Z</dc:date>
    </item>
    <item>
      <title>How calculate amount and remove duplicate ones</title>
      <link>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232151#M83807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Dec 2010 11:24:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-calculate-amount-and-remove-duplicate-ones/m-p/232151#M83807</guid>
      <dc:creator />
      <dc:date>2010-12-25T11:24:54Z</dc:date>
    </item>
  </channel>
</rss>

