<?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 only the values with a max date. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98346#M1248324</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking:&lt;/P&gt;&lt;P&gt;LOAD *, Floor(Date#(Date, 'YYYYMMDD')) AS DateID INLINE [&lt;/P&gt;&lt;P&gt;ID, Date, Category&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; 20170125,&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;1, 20170312, 2&lt;/P&gt;&lt;P&gt;2, 20170103, 1&lt;/P&gt;&lt;P&gt;2, 20170227, 1&lt;/P&gt;&lt;P&gt;3, 20170130, 1&lt;/P&gt;&lt;P&gt;3, 20170405, 1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Checking)&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(DateID) AS MaxDateID&lt;/P&gt;&lt;P&gt;Resident Checking&lt;/P&gt;&lt;P&gt;Group By ID&lt;/P&gt;&lt;P&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN(Checking)&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(DateID = MaxDateID, 1, 0) AS MaxFlag&lt;/P&gt;&lt;P&gt;Resident Checking&lt;/P&gt;&lt;P&gt;WHERE Category = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then using straight table add ID as dimension and &lt;/P&gt;&lt;P&gt;Expr: = Count({&amp;lt;MaxFlag = {1} &amp;gt;} ID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jul 2018 22:44:05 GMT</pubDate>
    <dc:creator>vishsaggi</dc:creator>
    <dc:date>2018-07-17T22:44:05Z</dc:date>
    <item>
      <title>Count only the values with a max date.</title>
      <link>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98345#M1248321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I have a table like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="174" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="border: 1px solid #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;THEAD style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; background-position: no-repeat; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; background-position: no-repeat; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; background-position: no-repeat; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;Category&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;20170125&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;20170312&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;20170103&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;20170227&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;20170130&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;20170405&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I want count only the IDs where the max date of the ID are category 1. If the max date of the ID is different to category 1, don't have to count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;For example if I do a count in this case the result is 2 (Second value of ID 2 and ID 3 because this &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;has category 1 on its highest date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Thank you for you support!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Regards!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98345#M1248321</guid>
      <dc:creator>kikerodriguez10</dc:creator>
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count only the values with a max date.</title>
      <link>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98346#M1248324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking:&lt;/P&gt;&lt;P&gt;LOAD *, Floor(Date#(Date, 'YYYYMMDD')) AS DateID INLINE [&lt;/P&gt;&lt;P&gt;ID, Date, Category&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; 20170125,&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;1, 20170312, 2&lt;/P&gt;&lt;P&gt;2, 20170103, 1&lt;/P&gt;&lt;P&gt;2, 20170227, 1&lt;/P&gt;&lt;P&gt;3, 20170130, 1&lt;/P&gt;&lt;P&gt;3, 20170405, 1&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Checking)&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(DateID) AS MaxDateID&lt;/P&gt;&lt;P&gt;Resident Checking&lt;/P&gt;&lt;P&gt;Group By ID&lt;/P&gt;&lt;P&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN(Checking)&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(DateID = MaxDateID, 1, 0) AS MaxFlag&lt;/P&gt;&lt;P&gt;Resident Checking&lt;/P&gt;&lt;P&gt;WHERE Category = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then using straight table add ID as dimension and &lt;/P&gt;&lt;P&gt;Expr: = Count({&amp;lt;MaxFlag = {1} &amp;gt;} ID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 22:44:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98346#M1248324</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-07-17T22:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count only the values with a max date.</title>
      <link>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98347#M1248328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vishwarath!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;This solution its very useful and works but I need that be flexible with filters and this value show in a text object so I think that I need to do with set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I did a set analysis with aggr function like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;=sum(aggr(count(DISTINCT {&amp;lt;Category={1}&amp;gt;}ID),ID))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;This does not consider the Date, only consider the distinc values with Category 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;How I can consider in this set analysis the max date value for each ID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 17:50:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98347#M1248328</guid>
      <dc:creator>kikerodriguez10</dc:creator>
      <dc:date>2018-07-18T17:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count only the values with a max date.</title>
      <link>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98348#M1248332</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;Count(DISTINCT {&amp;lt;ID = {"=Max(Date) = Max({&amp;lt;Category = {'1'}&amp;gt;}Date)"}&amp;gt;} ID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/208218_Capture.PNG" style="height: 263px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 18:15:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98348#M1248332</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-07-18T18:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count only the values with a max date.</title>
      <link>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98349#M1248334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works fine!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thank you very much for your help! &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:52:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-only-the-values-with-a-max-date/m-p/98349#M1248334</guid>
      <dc:creator>kikerodriguez10</dc:creator>
      <dc:date>2018-07-19T16:52:03Z</dc:date>
    </item>
  </channel>
</rss>

