<?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: Find a count of records within a date range using the max date records only in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Find-a-count-of-records-within-a-date-range-using-the-max-date/m-p/1970101#M80037</link>
    <description>&lt;P&gt;hello. MB will you help next function&lt;BR /&gt;aggr( Max( report_date ), username, agency ). You may receive max value of report_date for each username and agency&lt;/P&gt;</description>
    <pubDate>Thu, 18 Aug 2022 07:28:40 GMT</pubDate>
    <dc:creator>Timario</dc:creator>
    <dc:date>2022-08-18T07:28:40Z</dc:date>
    <item>
      <title>Find a count of records within a date range using the max date records only</title>
      <link>https://community.qlik.com/t5/App-Development/Find-a-count-of-records-within-a-date-range-using-the-max-date/m-p/1969891#M80028</link>
      <description>&lt;P&gt;&lt;SPAN&gt;My goal is to &lt;/SPAN&gt;&lt;STRONG&gt;find a count of records within a date range using the max date records only&lt;/STRONG&gt;&lt;SPAN&gt; for that date range. For example I would like to find the record count by agency with a max report_date within a date range based on report_date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I used the following expression to get an accurate KPI count however when I use the same expression in a bar chart the agency counts are not accurate because they are not calculated on the max report_date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;[report_date] = {"$(='&amp;gt;=' &amp;amp; '07/01/2020' &amp;amp; '&amp;lt;=' &amp;amp; '06/30/2021')"}&amp;gt;} distinct [username])&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below is an example of the data. I would like to count only the highlighted records&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Darren1_0-1660756578487.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/86940iC92F0AE7EBC96F4F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Darren1_0-1660756578487.png" alt="Darren1_0-1660756578487.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 17:24:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-a-count-of-records-within-a-date-range-using-the-max-date/m-p/1969891#M80028</guid>
      <dc:creator>Darren1</dc:creator>
      <dc:date>2022-08-17T17:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Find a count of records within a date range using the max date records only</title>
      <link>https://community.qlik.com/t5/App-Development/Find-a-count-of-records-within-a-date-range-using-the-max-date/m-p/1970046#M80033</link>
      <description>&lt;P&gt;Hi, maybe somebody can give set analysis option for this, but I can provide not so elegant solution to try, which takes max report_date for each username and check if it between date range:&lt;/P&gt;
&lt;P&gt;sum(if( aggr(date(max(report_date)), username)&amp;gt;='07/01/2020' and aggr(date(max(report_date)), username)&amp;lt;= '06/30/2021', 1))&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 05:59:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-a-count-of-records-within-a-date-range-using-the-max-date/m-p/1970046#M80033</guid>
      <dc:creator>justISO</dc:creator>
      <dc:date>2022-08-18T05:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find a count of records within a date range using the max date records only</title>
      <link>https://community.qlik.com/t5/App-Development/Find-a-count-of-records-within-a-date-range-using-the-max-date/m-p/1970101#M80037</link>
      <description>&lt;P&gt;hello. MB will you help next function&lt;BR /&gt;aggr( Max( report_date ), username, agency ). You may receive max value of report_date for each username and agency&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 07:28:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-a-count-of-records-within-a-date-range-using-the-max-date/m-p/1970101#M80037</guid>
      <dc:creator>Timario</dc:creator>
      <dc:date>2022-08-18T07:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find a count of records within a date range using the max date records only</title>
      <link>https://community.qlik.com/t5/App-Development/Find-a-count-of-records-within-a-date-range-using-the-max-date/m-p/1997078#M82567</link>
      <description>&lt;P&gt;Thank your for help with the expression.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To make this work I used the expression below in the chart. Then I adjusted the load script to find the most recent username and ordered them by username, report_date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;[report_date] = {"$(='&amp;gt;=' &amp;amp; '07/01/2022' &amp;amp; '&amp;lt;=' &amp;amp; '06/30/2023')"}&amp;gt;} distinct username)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Darren1_0-1666787309946.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92217iACA4C90E908E23F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Darren1_0-1666787309946.png" alt="Darren1_0-1666787309946.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:31:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-a-count-of-records-within-a-date-range-using-the-max-date/m-p/1997078#M82567</guid>
      <dc:creator>Darren1</dc:creator>
      <dc:date>2022-10-26T12:31:42Z</dc:date>
    </item>
  </channel>
</rss>

