<?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: Count for max date in a month in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Count-for-max-date-in-a-month/m-p/2505172#M103904</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/119197"&gt;@AlphaNik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;count( {&amp;lt;fact_date={"=fact_date=aggr(max(fact_date), fact_monthName)"}&amp;gt;} distinct fact_id)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let me know&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards Jandre&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Feb 2025 12:21:33 GMT</pubDate>
    <dc:creator>JandreKillianRIC</dc:creator>
    <dc:date>2025-02-10T12:21:33Z</dc:date>
    <item>
      <title>Count for max date in a month</title>
      <link>https://community.qlik.com/t5/App-Development/Count-for-max-date-in-a-month/m-p/2505155#M103900</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a fact table with a unique id, a date and month name.&lt;/P&gt;
&lt;P&gt;ex:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;fact_id&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;fact_date&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;fact_monthName&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;21/01/2025&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;jan 25&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;31/01/2025&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;jan 25&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;07/02/2025&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;feb 25&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to write an expression to count my fact, but only for the last possible date of every month (based on current selection). in my example, if year 2025 would be selected, I should count id #2 for january and #3 for february.&lt;/P&gt;
&lt;P&gt;I tried something like this:&lt;/P&gt;
&lt;P&gt;=count( {&amp;lt;fact_date={"=aggr(max(fact_date), fact_monthName)"}&amp;gt;} distinct fact_id)&lt;/P&gt;
&lt;P&gt;The expression is read, so it seems correct syntax wise, but the values are not what I expected. It seeems to count values for different dates.&lt;/P&gt;
&lt;P&gt;Any help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 11:07:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-for-max-date-in-a-month/m-p/2505155#M103900</guid>
      <dc:creator>AlphaNik</dc:creator>
      <dc:date>2025-02-10T11:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Count for max date in a month</title>
      <link>https://community.qlik.com/t5/App-Development/Count-for-max-date-in-a-month/m-p/2505172#M103904</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/119197"&gt;@AlphaNik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;count( {&amp;lt;fact_date={"=fact_date=aggr(max(fact_date), fact_monthName)"}&amp;gt;} distinct fact_id)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let me know&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards Jandre&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 12:21:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-for-max-date-in-a-month/m-p/2505172#M103904</guid>
      <dc:creator>JandreKillianRIC</dc:creator>
      <dc:date>2025-02-10T12:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Count for max date in a month</title>
      <link>https://community.qlik.com/t5/App-Development/Count-for-max-date-in-a-month/m-p/2505207#M103917</link>
      <description>&lt;P&gt;Thank you, it worked.&lt;/P&gt;
&lt;P&gt;Only thing, i had to create a temp table in order to order by date. For some reason it seems the value for aggr is evaluated only for the first row in load order (with monthName as a dimension). I tried to play with order by clause inside aggr to no avail.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway it's working!&lt;/P&gt;
&lt;P&gt;Regards Nik&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 15:08:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-for-max-date-in-a-month/m-p/2505207#M103917</guid>
      <dc:creator>AlphaNik</dc:creator>
      <dc:date>2025-02-10T15:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count for max date in a month</title>
      <link>https://community.qlik.com/t5/App-Development/Count-for-max-date-in-a-month/m-p/2505212#M103920</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/119197"&gt;@AlphaNik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Great news! Im also struggling on an aggr sort. Should post something soon for other people to help me on this one!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards Jandre&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 15:24:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-for-max-date-in-a-month/m-p/2505212#M103920</guid>
      <dc:creator>JandreKillianRIC</dc:creator>
      <dc:date>2025-02-10T15:24:14Z</dc:date>
    </item>
  </channel>
</rss>

