<?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 Identify max date for every ID field. in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2089957#M89348</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I have a chart where I need to identify the row which contains the max date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expression used:&lt;/P&gt;
&lt;P&gt;if(Aggr(&lt;BR /&gt;Count({&amp;lt;[EVENT]={'AIR'},[Month Num]={'&amp;lt;=$(#vSelectedMonthNumber)'},[Start Date]= {"$(=Max([Start Date]))"},[Event Month]=&amp;gt;} DISTINCT [ID])&lt;BR /&gt;,[ID],[Start Date])&amp;gt;0,'Y')&lt;/P&gt;
&lt;P&gt;Input:&lt;/P&gt;
&lt;TABLE width="139"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="75"&gt;Start Date&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;01/01/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;10/01/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;22/01/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;15/12/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;03/04/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;10/19/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;TABLE width="203"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="75"&gt;Start Date&lt;/TD&gt;
&lt;TD width="64"&gt;Expr&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;10/01/2023&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;22/01/2023&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;15/12/2023&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;10/19/2023&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jul 2023 10:50:25 GMT</pubDate>
    <dc:creator>Krish</dc:creator>
    <dc:date>2023-07-03T10:50:25Z</dc:date>
    <item>
      <title>Identify max date for every ID field.</title>
      <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2089957#M89348</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I have a chart where I need to identify the row which contains the max date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expression used:&lt;/P&gt;
&lt;P&gt;if(Aggr(&lt;BR /&gt;Count({&amp;lt;[EVENT]={'AIR'},[Month Num]={'&amp;lt;=$(#vSelectedMonthNumber)'},[Start Date]= {"$(=Max([Start Date]))"},[Event Month]=&amp;gt;} DISTINCT [ID])&lt;BR /&gt;,[ID],[Start Date])&amp;gt;0,'Y')&lt;/P&gt;
&lt;P&gt;Input:&lt;/P&gt;
&lt;TABLE width="139"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="75"&gt;Start Date&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;01/01/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;10/01/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;22/01/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;15/12/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;03/04/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;10/19/2023&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;TABLE width="203"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="75"&gt;Start Date&lt;/TD&gt;
&lt;TD width="64"&gt;Expr&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;10/01/2023&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;22/01/2023&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;15/12/2023&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;10/19/2023&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 10:50:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2089957#M89348</guid>
      <dc:creator>Krish</dc:creator>
      <dc:date>2023-07-03T10:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Identify max date for every ID field.</title>
      <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2089980#M89349</link>
      <description>&lt;P&gt;use below expression:-&lt;/P&gt;
&lt;P&gt;Date(sum(total&amp;lt;ID&amp;gt;aggr(date(max([Start Date])),ID)))&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="udit_k_0-1688383440934.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/111478i5672FDDAA034A4BA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="udit_k_0-1688383440934.png" alt="udit_k_0-1688383440934.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>Mon, 03 Jul 2023 11:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2089980#M89349</guid>
      <dc:creator>udit_k</dc:creator>
      <dc:date>2023-07-03T11:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Identify max date for every ID field.</title>
      <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2089981#M89350</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/186789"&gt;@udit_k&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thanks for your response. The final output should display only the row which has max date. In above example, for ID 1, it should show 10/01/2023 which is the max date ( 1 row)&amp;nbsp; and for ID 2 10/01/2023 etc. I do not want to show 01/01/2023 row item.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 11:32:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2089981#M89350</guid>
      <dc:creator>Krish</dc:creator>
      <dc:date>2023-07-03T11:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Identify max date for every ID field.</title>
      <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2089990#M89351</link>
      <description>&lt;P&gt;use below expression and uncheck Include zero value in data handling&lt;/P&gt;
&lt;P&gt;aggr(date(max([Start Date])),ID)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="udit_k_0-1688384713640.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/111479i2B62AC281DFF7773/image-size/medium?v=v2&amp;amp;px=400" role="button" title="udit_k_0-1688384713640.png" alt="udit_k_0-1688384713640.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 11:45:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2089990#M89351</guid>
      <dc:creator>udit_k</dc:creator>
      <dc:date>2023-07-03T11:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Identify max date for every ID field.</title>
      <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090029#M89357</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/68136"&gt;@Krish&lt;/a&gt;&amp;nbsp;I would do something like that in a script.&lt;/P&gt;
&lt;P&gt;Data:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;ID,Start Date&lt;BR /&gt;1, 01/01/2023&lt;BR /&gt;1, 10/01/2023&lt;BR /&gt;2, 22/01/2023&lt;BR /&gt;3, 15/12/2023&lt;BR /&gt;3, 03/04/2023&lt;BR /&gt;4, 10/19/2023];&lt;/P&gt;
&lt;P&gt;Inner Join&lt;BR /&gt;LOAD ID,&lt;BR /&gt;Max("Start Date") as "Start Date",&lt;BR /&gt;'Y' as Expr&lt;/P&gt;
&lt;P&gt;Resident Data&lt;BR /&gt;Group By ID;&lt;/P&gt;
&lt;P&gt;Exit Script;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 20:30:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090029#M89357</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2023-07-03T20:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Identify max date for every ID field.</title>
      <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090032#M89358</link>
      <description>&lt;P&gt;I am using QlikView.&amp;nbsp; I tried this in the chart but it doesn't give the intended results.&lt;/P&gt;
&lt;P&gt;if(date(Count(TOTAL&amp;lt;[ID]&amp;gt;aggr(date(max([Start Date])),[ID])))&amp;gt;0,'Y')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It still gives me 2 rows.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 12:51:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090032#M89358</guid>
      <dc:creator>Krish</dc:creator>
      <dc:date>2023-07-03T12:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Identify max date for every ID field.</title>
      <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090034#M89359</link>
      <description>&lt;P&gt;I need both rows for other calculations. I cannot make the changes in script level.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 12:52:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090034#M89359</guid>
      <dc:creator>Krish</dc:creator>
      <dc:date>2023-07-03T12:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Identify max date for every ID field.</title>
      <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090051#M89362</link>
      <description>&lt;P&gt;use below exp in dimension :-&lt;/P&gt;
&lt;P&gt;if(Date((aggr(date(max([Start Date])),[ID])))&amp;gt;0,'Y')&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="udit_k_0-1688393476165.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/111486i639EE992EE386F76/image-size/medium?v=v2&amp;amp;px=400" role="button" title="udit_k_0-1688393476165.png" alt="udit_k_0-1688393476165.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 14:11:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090051#M89362</guid>
      <dc:creator>udit_k</dc:creator>
      <dc:date>2023-07-03T14:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Identify max date for every ID field.</title>
      <link>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090140#M89366</link>
      <description>&lt;P&gt;Format the date field properly,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrunPierre_0-1688414893057.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/111501i991D1CF080915F9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BrunPierre_0-1688414893057.png" alt="BrunPierre_0-1688414893057.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then try this;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;=Only(Aggr(If([Start Date] = Max(TOTAL &amp;lt;ID&amp;gt; [Start Date]),[Start Date]), ID, [Start Date]))&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 20:32:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Identify-max-date-for-every-ID-field/m-p/2090140#M89366</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2023-07-03T20:32:33Z</dc:date>
    </item>
  </channel>
</rss>

