<?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 Re: Using Aggr() and and DISTINCT in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106773#M766885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think the composite key would help because the issue is I want the duplicate ReceivableID's removed. If I was able to create a composite key then duplicates of the ReceivableID would each have their own unique key and would still be counted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your second suggestion got the number closer. I'm not sure if it is a coicidence but maybe I can work off of that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jul 2018 12:13:32 GMT</pubDate>
    <dc:creator>greend21</dc:creator>
    <dc:date>2018-07-05T12:13:32Z</dc:date>
    <item>
      <title>Using Aggr() and and DISTINCT</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106768#M766880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the below expression but in my data the Receivable ID's can be listed multiple times depending on the number of transactions that receivableID is involved in. The calculation for EfftDtCollEfft, which is in the load script, will result in the same number for each record of a receivableID which is fine. The issue is the values are weighted so I would like it to look at the EfftDtCollEfft per distinct receivableid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg({$&amp;lt;RecOpenStatus={'Closed'}, RecCloseFlag= {1}, RecCloseCategory = {'Collected'}&amp;gt;} EfftDtCollEfft)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example the data could look like this chart. I would want my Avg() to be 5, not 6. Could you offer any help with the Aggr function? I was trying it but when I compare the numbers to excel they do not look right in Qlik.&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 241px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" style="border: 0.5pt solid windowtext; border-image: none;" width="88"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;ReceivableID&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0.5pt 0.5pt 0px; border-style: solid solid solid none; border-color: windowtext windowtext windowtext black;" width="64"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;AllocAmt&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border-width: 0.5pt 0.5pt 0.5pt 0px; border-style: solid solid solid none; border-color: windowtext windowtext windowtext black;" width="89"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;EfftDtCollEfft&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black windowtext windowtext;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;$10 &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;8&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black windowtext windowtext;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;$50 &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;8&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black windowtext windowtext;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;$60 &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;8&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black windowtext windowtext;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;$40 &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black windowtext windowtext;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;$10 &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;5&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black windowtext windowtext;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;$10 &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black windowtext windowtext black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;5&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106768#M766880</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr() and and DISTINCT</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106769#M766881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm always nervous about an average of an average, but how about&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Avg(Aggr(Avg({$&amp;lt;RecOpenStatus={'Closed'}, RecCloseFlag= {1}, RecCloseCategory = {'Collected'}&amp;gt;} EfftDtCollEfft),ReceivableID))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2018 19:00:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106769#M766881</guid>
      <dc:creator>jwjackso</dc:creator>
      <dc:date>2018-07-03T19:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr() and and DISTINCT</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106770#M766882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This doesnt give the expected result either compared to excel but it is close. Using the average of the sum brings me to what I calculated in Excel before I remove the duplicate values for receivableID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg(Aggr(Sum({$&amp;lt;RecOpenStatus={'Closed'}, RecCloseFlag= {1}, RecCloseCategory = {'Collected'}&amp;gt;} EfftDtCollEfft),ReceivableID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2018 19:04:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106770#M766882</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-07-03T19:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr() and and DISTINCT</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106771#M766883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be:&lt;/P&gt;&lt;P&gt;Avg(Aggr(Distinct Sum({$&amp;lt;RecOpenStatus={"Closed"}, RecCloseFlag= {1}, RecCloseCategory = {"Collected"}&amp;gt;} EfftDtCollEfft),ReceivableID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 08:22:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106771#M766883</guid>
      <dc:creator>BalaBhaskar_Qlik</dc:creator>
      <dc:date>2018-07-04T08:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr() and and DISTINCT</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106772#M766884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Create a composite key( combination of fields to get distinct values) in the script if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=Avg(Aggr(Distinct Sum({$&amp;lt;RecOpenStatus={"Closed"}, RecCloseFlag= {1}, RecCloseCategory = {"Collected"}&amp;gt;} EfftDtCollEfft), &lt;STRONG&gt;CompositeKey&lt;/STRONG&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OR try &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Avg(Aggr(Distinct Sum({$&amp;lt;RecOpenStatus={"Closed"}, RecCloseFlag= {1}, RecCloseCategory = {"Collected"}&amp;gt;} EfftDtCollEfft), &lt;STRONG&gt; &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;ReceivableID,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 16px; font-family: Calibri;"&gt;&lt;STRONG&gt;AllocAmt&lt;/STRONG&gt;&lt;/SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 09:44:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106772#M766884</guid>
      <dc:creator>sasikanth</dc:creator>
      <dc:date>2018-07-04T09:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr() and and DISTINCT</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106773#M766885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think the composite key would help because the issue is I want the duplicate ReceivableID's removed. If I was able to create a composite key then duplicates of the ReceivableID would each have their own unique key and would still be counted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your second suggestion got the number closer. I'm not sure if it is a coicidence but maybe I can work off of that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2018 12:13:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106773#M766885</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-07-05T12:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr() and and DISTINCT</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106774#M766886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I was comparing in excel I missed filtering one thing out. This gives me the expected result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2018 12:46:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-and-and-DISTINCT/m-p/106774#M766886</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-07-05T12:46:28Z</dc:date>
    </item>
  </channel>
</rss>

