<?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 Sum Field Based on a Distinct Field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-Field-Based-on-a-Distinct-Field/m-p/196383#M501146</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to get a sum in a chart that is being backed by a table with a large amount of data.&lt;/P&gt;&lt;P&gt;I will start with a quick description:&lt;/P&gt;&lt;P&gt;All the fields I am working with have a unique value that is being duplicated due to merging of other tables prior to its final stage.&lt;/P&gt;&lt;P&gt;Dimension 1: [Application Type]&lt;/P&gt;&lt;P&gt;Expression 1: count(DISTINCT if(STATUS = 'COMPLETE', [APPLICANT KEY]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression 2: &lt;B&gt;SUM&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(STATUS = 'COMPLETE', &lt;B&gt;[Completion Time Calculation]&lt;/B&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; Expression 3: (2/1) &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; Expression 3: (2/1)&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression 3: (2/1)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The issue I am running into is that since there are duplicates now in the table, even though I am working with all fields that have a single value repeated in the duplicates, the result for Expression 2 is being exaggerated immensely. Is there a way to sum the [Completion Time Calculation] based on a Distinct [APPLICANT KEY], sort of how I do above, thus eliminating duplicate completion times from being summed?&lt;/P&gt;&lt;P&gt;I have tried anything I could think of to no avail. Any and all help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;A.&lt;/P&gt;&lt;P&gt;QV Version 9.00.7646.9 SR6&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Feb 2011 22:04:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-02-01T22:04:55Z</dc:date>
    <item>
      <title>Sum Field Based on a Distinct Field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Field-Based-on-a-Distinct-Field/m-p/196383#M501146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to get a sum in a chart that is being backed by a table with a large amount of data.&lt;/P&gt;&lt;P&gt;I will start with a quick description:&lt;/P&gt;&lt;P&gt;All the fields I am working with have a unique value that is being duplicated due to merging of other tables prior to its final stage.&lt;/P&gt;&lt;P&gt;Dimension 1: [Application Type]&lt;/P&gt;&lt;P&gt;Expression 1: count(DISTINCT if(STATUS = 'COMPLETE', [APPLICANT KEY]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression 2: &lt;B&gt;SUM&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(STATUS = 'COMPLETE', &lt;B&gt;[Completion Time Calculation]&lt;/B&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; Expression 3: (2/1) &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; Expression 3: (2/1)&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression 3: (2/1)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The issue I am running into is that since there are duplicates now in the table, even though I am working with all fields that have a single value repeated in the duplicates, the result for Expression 2 is being exaggerated immensely. Is there a way to sum the [Completion Time Calculation] based on a Distinct [APPLICANT KEY], sort of how I do above, thus eliminating duplicate completion times from being summed?&lt;/P&gt;&lt;P&gt;I have tried anything I could think of to no avail. Any and all help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;A.&lt;/P&gt;&lt;P&gt;QV Version 9.00.7646.9 SR6&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2011 22:04:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Field-Based-on-a-Distinct-Field/m-p/196383#M501146</guid>
      <dc:creator />
      <dc:date>2011-02-01T22:04:55Z</dc:date>
    </item>
    <item>
      <title>Sum Field Based on a Distinct Field</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Field-Based-on-a-Distinct-Field/m-p/196384#M501147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;(aggr(DISTINCT[completion time], [app_key]))/COUNT(DISTINCT [app_key] &lt;P&gt;)&lt;/P&gt;&lt;P&gt;Aggr for the win... this is what solved my problem, in case this would help anyone else.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2011 23:24:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Field-Based-on-a-Distinct-Field/m-p/196384#M501147</guid>
      <dc:creator />
      <dc:date>2011-02-01T23:24:58Z</dc:date>
    </item>
  </channel>
</rss>

