<?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: Calculate distinct count by group in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-distinct-count-by-group/m-p/1893563#M1217406</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6622"&gt;@hic&lt;/a&gt;&amp;nbsp;wrote:&amp;nbsp;&lt;A title="myccpay" href="https://www.myccpay.biz/" target="_self"&gt;&lt;FONT color="#FFFFFF"&gt;myccpay&lt;/FONT&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;Region=,Commodities=E({&amp;lt;Status= {'Complete'}&amp;gt;} Commodities)*P({&amp;lt;Status= {'InProgress'}&amp;gt;} Commodities)&amp;gt;} distinct Commodities)&lt;/P&gt;
&lt;P&gt;The E()-function returns values of "Commodities" that don't have status&amp;nbsp;'Complete'.&lt;/P&gt;
&lt;P&gt;The P()-function returns values of "Commodities" that have status&amp;nbsp;'InProgress'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thank you for the reply, My query has been solved.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Feb 2022 04:07:34 GMT</pubDate>
    <dc:creator>Blalock69</dc:creator>
    <dc:date>2022-02-17T04:07:34Z</dc:date>
    <item>
      <title>Calculate distinct count by group</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-distinct-count-by-group/m-p/1890699#M1217265</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;I have a table in which I have multiple records for the same Commodity with different status. I would like to write an expression in which I want to count number of Commodities with 'InProgress' status. The record should get counted only if the status is not Completed for the same commodity. There may be additional records for the same Commodity with another Status (Void) but I don't have to account for that.&lt;/P&gt;
&lt;P&gt;For below table, the count of Commodities of InProgress is 2.&lt;/P&gt;
&lt;TABLE width="388"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="133"&gt;Commodities&lt;/TD&gt;
&lt;TD width="131"&gt;Sub Commodity&lt;/TD&gt;
&lt;TD width="124"&gt;Status&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="133"&gt;Comm1&lt;/TD&gt;
&lt;TD width="131"&gt;SC1&lt;/TD&gt;
&lt;TD width="124"&gt;Void&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="133"&gt;Comm1&lt;/TD&gt;
&lt;TD width="131"&gt;SC2&lt;/TD&gt;
&lt;TD width="124"&gt;InProgress&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="133"&gt;Comm1&lt;/TD&gt;
&lt;TD width="131"&gt;SC3&lt;/TD&gt;
&lt;TD width="124"&gt;InProgress&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="133"&gt;Comm2&lt;/TD&gt;
&lt;TD width="131"&gt;SC1&lt;/TD&gt;
&lt;TD width="124"&gt;Void&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="133"&gt;Comm2&lt;/TD&gt;
&lt;TD width="131"&gt;SC2&lt;/TD&gt;
&lt;TD width="124"&gt;Complete&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="133"&gt;Comm3&lt;/TD&gt;
&lt;TD width="131"&gt;SC1&lt;/TD&gt;
&lt;TD width="124"&gt;Complete&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="133"&gt;Comm3&lt;/TD&gt;
&lt;TD width="131"&gt;SC2&lt;/TD&gt;
&lt;TD width="124"&gt;InProgress&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="133"&gt;Comm4&lt;/TD&gt;
&lt;TD width="131"&gt;SC1&lt;/TD&gt;
&lt;TD width="124"&gt;InProgress&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Comm1 doesn't have Complete Status so it should get counted as 1 for InProgress&lt;/P&gt;
&lt;P&gt;Comm2 doesn't have InProgress status so it won't get counted.&lt;/P&gt;
&lt;P&gt;Comm3 has Complete and InProgress both so we don't need to count as it is already Completed&lt;/P&gt;
&lt;P&gt;Comm4 has InProgress so we need to count it as 1 So, total InProgress Status count for the below table is 2.&lt;/P&gt;
&lt;P&gt;Hope this example helps&amp;nbsp; and this is the expression which I came up -&lt;/P&gt;
&lt;P&gt;=Count({&amp;lt;Region=&amp;gt;} Aggr(If( Status = 'InProgress' and Status &amp;lt;&amp;gt; 'Complete' , Status), Commodities, Commodities))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also want Region filter not to get applied but that is also not working.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 05:16:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-distinct-count-by-group/m-p/1890699#M1217265</guid>
      <dc:creator>sam1508</dc:creator>
      <dc:date>2022-02-09T05:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct count by group</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-distinct-count-by-group/m-p/1890832#M1217273</link>
      <description>&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;Count({&amp;lt;Region=,Commodities=E({&amp;lt;Status= {'Complete'}&amp;gt;} Commodities)*P({&amp;lt;Status= {'InProgress'}&amp;gt;} Commodities)&amp;gt;} distinct Commodities)&lt;/P&gt;&lt;P&gt;The E()-function returns values of "Commodities" that don't have status&amp;nbsp;'Complete'.&lt;/P&gt;&lt;P&gt;The P()-function returns values of "Commodities" that have status&amp;nbsp;'InProgress'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 08:39:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-distinct-count-by-group/m-p/1890832#M1217273</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2022-02-09T08:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate distinct count by group</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-distinct-count-by-group/m-p/1893563#M1217406</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6622"&gt;@hic&lt;/a&gt;&amp;nbsp;wrote:&amp;nbsp;&lt;A title="myccpay" href="https://www.myccpay.biz/" target="_self"&gt;&lt;FONT color="#FFFFFF"&gt;myccpay&lt;/FONT&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;Region=,Commodities=E({&amp;lt;Status= {'Complete'}&amp;gt;} Commodities)*P({&amp;lt;Status= {'InProgress'}&amp;gt;} Commodities)&amp;gt;} distinct Commodities)&lt;/P&gt;
&lt;P&gt;The E()-function returns values of "Commodities" that don't have status&amp;nbsp;'Complete'.&lt;/P&gt;
&lt;P&gt;The P()-function returns values of "Commodities" that have status&amp;nbsp;'InProgress'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thank you for the reply, My query has been solved.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 04:07:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-distinct-count-by-group/m-p/1893563#M1217406</guid>
      <dc:creator>Blalock69</dc:creator>
      <dc:date>2022-02-17T04:07:34Z</dc:date>
    </item>
  </channel>
</rss>

