<?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: Help needed with Aggr() function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943164#M325092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(Aggr(Count(DISTINCT organization_survey_respondent_id), client_id, close_date_cal), -Aggr(Max(&lt;SPAN style="font-size: 13.3333px;"&gt;close_date_cal&lt;/SPAN&gt;), &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;client_id))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Nov 2015 18:14:18 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-11-19T18:14:18Z</dc:date>
    <item>
      <title>Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943163#M325091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I have the following data: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/106115_Capture.PNG" style="height: 249px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;And my problem is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see I have a client ID with two &lt;STRONG&gt;closed dates&lt;/STRONG&gt;. The issue is that I need to count only the "Promoter" category for &lt;STRONG&gt;August&lt;/STRONG&gt;, but the count is giving me the total of 5, instead of 2... how can I fix this?&lt;/P&gt;&lt;P&gt;As you can see in the second chart I have a column that uses&lt;STRONG&gt; Aggr()&lt;/STRONG&gt; to get the &lt;STRONG&gt;max closed date&lt;/STRONG&gt;, but I don't know to make the column "count" to count only those and &lt;STRONG&gt;ignore the data from January&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help on the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 17:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943163#M325091</guid>
      <dc:creator />
      <dc:date>2015-11-19T17:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943164#M325092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(Aggr(Count(DISTINCT organization_survey_respondent_id), client_id, close_date_cal), -Aggr(Max(&lt;SPAN style="font-size: 13.3333px;"&gt;close_date_cal&lt;/SPAN&gt;), &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;client_id))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 18:14:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943164#M325092</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-19T18:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943165#M325093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the reply &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;sunindia&lt;/A&gt;‌, nevertheless it gave an answer of "6" which remains wrong.... even changing the code a little bit to the following&lt;/P&gt;&lt;P&gt;=FirstSortedValue(Aggr(Count({$&amp;lt;NPS_Category = {'Promoter'}&amp;gt;}DISTINCT organization_survey_respondent_id), client_id, close_date_cal), -Aggr(Max(close_date_cal), client_id))&lt;/P&gt;&lt;P&gt;it gives "3" as an answer when it is supposed to be "2"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 19:23:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943165#M325093</guid>
      <dc:creator />
      <dc:date>2015-11-19T19:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943166#M325094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about this:&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;&lt;STRONG&gt;=FirstSortedValue(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="color: #ff0000;"&gt;{$&amp;lt;NPS_Category = {'Promoter'}&amp;gt;}&lt;/SPAN&gt; &lt;/SPAN&gt;Aggr(Count({$&amp;lt;NPS_Category = {'Promoter'}&amp;gt;}DISTINCT organization_survey_respondent_id), client_id, close_date_cal), -Aggr(Max(&lt;SPAN style="color: #ff0000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{$&amp;lt;NPS_Category = {'Promoter'}&amp;gt;} &lt;/SPAN&gt;close_date_cal), client_id))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 19:53:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943166#M325094</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-19T19:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943167#M325095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nop, unfortunately still "3":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/106136_Capture.PNG" style="height: 127px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 20:41:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943167#M325095</guid>
      <dc:creator />
      <dc:date>2015-11-19T20:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943168#M325096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 20:50:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943168#M325096</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-19T20:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943169#M325097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;yes, sure.. here you have... now, as you look deeper in the example this is when it becomes more complicated:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;We need for example to count the &lt;EM&gt;&lt;STRONG&gt;Promoters&lt;/STRONG&gt;&lt;/EM&gt; for the whole &lt;STRONG&gt;Fiscal Year&lt;/STRONG&gt;..... but you see, for example, &lt;STRONG&gt;client 120&lt;/STRONG&gt; has two events during the year&lt;STRONG&gt; (Jan and Aug)&lt;/STRONG&gt;...&amp;nbsp; and we &lt;STRONG&gt;should count only the most recent one (Aug)&lt;/STRONG&gt;... so far so good.... but, if the user select &lt;STRONG&gt;Jan&lt;/STRONG&gt; as a Month, we should show the count for that month.... I apologize if it is too complicated. We are hoping that a combination or Aggr and Count can make the trick.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Files attached into the original question. &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I really appreciate all your assistance..... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 21:19:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943169#M325097</guid>
      <dc:creator />
      <dc:date>2015-11-19T21:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943170#M325098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This expression seems to work. Can you verify?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=FirstSortedValue({$&amp;lt;NPS_Category = {'Promoter'}&amp;gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(Count({$&amp;lt;NPS_Category = {'Promoter'}&amp;gt;}DISTINCT organization_survey_respondent_id), client_id, close_date_cal),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-Aggr(Max({$&amp;lt;NPS_Category = {'Promoter'}&amp;gt;} close_date_cal), client_id, close_date_cal))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 21:24:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943170#M325098</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-19T21:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943171#M325099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;In your Excel file in the field close_date_cal some of the entries are dates and others are timestamps. &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;Compare lines 442 and 1293 in the sheet.&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;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;One has a value of 08/10/2015 the other 08/10/2015&amp;nbsp; 09:20:23.&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;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;In the load script try this to load that field &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;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;floor(Date(close_date_cal)) as close_date_cal &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;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Count(distinct close_date_cal) was 366 but now becomes 212.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 21:45:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943171#M325099</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2015-11-19T21:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943172#M325100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the count of 5 you had was correct. 2 is correct if you have selected the date of 08/10/2015.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;client_id_NPS&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;close_date_cal&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Count({$&amp;lt;NPS_Category = {'Promoter'}&amp;gt;}Distinct organization_survey_respondent_id)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TD bgcolor="#f5f5f5"&gt; &lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt; &lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;STRONG&gt;5 &lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;120&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;08/10/2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;120&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;01/23/2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 21:56:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943172#M325100</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2015-11-19T21:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943173#M325101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, whenever I have this issue, I just use a simple "Sum(if", e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(if(NPS_Category='Promoter',1,0) and it worked fine for me:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sumif.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/106216_sumif.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:18:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943173#M325101</guid>
      <dc:creator />
      <dc:date>2015-11-20T14:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943174#M325102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;sunindia&lt;/A&gt;‌.... it seems to be working and giving me the number I need. Thanks for you help, now I will try to apply the same logic to fullfil the need we have. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really appreciate it!! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:54:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-with-Aggr-function/m-p/943174#M325102</guid>
      <dc:creator />
      <dc:date>2015-11-20T14:54:37Z</dc:date>
    </item>
  </channel>
</rss>

