<?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 Max of two date fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-of-two-date-fields/m-p/772268#M274004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;I have this table in input (&lt;SPAN style="color: #0433ff; font-size: 16px;"&gt;tbl_INPUT&lt;/SPAN&gt;), and I need to find, for each ID, the max DATE and, &lt;SPAN style="text-decoration: underline;"&gt;within the same date&lt;/SPAN&gt;, the max DATE_INSERT (system timestamp).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;Andrew&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;tbl_INPUT:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;&lt;SPAN style="color: #0433ff;"&gt;LOAD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; * &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;inline&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;[&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; ID, DATE, DATE_INSERT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; &lt;STRONG&gt;1230,31-dic-09,14/08/2008 13:19&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; 1230,31-dic-09,01/08/2010 16:13&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; &lt;STRONG&gt;1235,14-ago-08,10/08/2008 17:19&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; 1235,14-ago-08,10/08/2008 16:11&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; &lt;STRONG&gt;1236,01-gen-09,02/02/2009 12:18&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 12pt;"&gt; ]&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;the desired &lt;SPAN style="color: #000000; font-size: 16px;"&gt;output&lt;/SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; 1230,31-dic-09,14/08/2008 13:19&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; 1235,14-ago-08,10/08/2008 17:19&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; 1236,01-gen-09,02/02/2009 12:18 &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Dec 2014 19:32:16 GMT</pubDate>
    <dc:creator>andrew001</dc:creator>
    <dc:date>2014-12-21T19:32:16Z</dc:date>
    <item>
      <title>Max of two date fields</title>
      <link>https://community.qlik.com/t5/QlikView/Max-of-two-date-fields/m-p/772268#M274004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;I have this table in input (&lt;SPAN style="color: #0433ff; font-size: 16px;"&gt;tbl_INPUT&lt;/SPAN&gt;), and I need to find, for each ID, the max DATE and, &lt;SPAN style="text-decoration: underline;"&gt;within the same date&lt;/SPAN&gt;, the max DATE_INSERT (system timestamp).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;Andrew&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #0433ff; font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;tbl_INPUT:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;&lt;SPAN style="color: #0433ff;"&gt;LOAD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; * &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;inline&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;[&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; ID, DATE, DATE_INSERT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; &lt;STRONG&gt;1230,31-dic-09,14/08/2008 13:19&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; 1230,31-dic-09,01/08/2010 16:13&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; &lt;STRONG&gt;1235,14-ago-08,10/08/2008 17:19&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; 1235,14-ago-08,10/08/2008 16:11&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt; &lt;STRONG&gt;1236,01-gen-09,02/02/2009 12:18&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 12pt;"&gt; ]&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;the desired &lt;SPAN style="color: #000000; font-size: 16px;"&gt;output&lt;/SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; 1230,31-dic-09,14/08/2008 13:19&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; 1235,14-ago-08,10/08/2008 17:19&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt; 1236,01-gen-09,02/02/2009 12:18 &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 19:32:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-of-two-date-fields/m-p/772268#M274004</guid>
      <dc:creator>andrew001</dc:creator>
      <dc:date>2014-12-21T19:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Max of two date fields</title>
      <link>https://community.qlik.com/t5/QlikView/Max-of-two-date-fields/m-p/772269#M274005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is to get one row for every ID, the first order by DATE desc and DATE_INSERT desc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14191906953355606" jivemacro_uid="_14191906953355606"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tbl_INPUT:&lt;/P&gt;
&lt;P&gt;LOAD * &lt;/P&gt;
&lt;P&gt;inline&lt;/P&gt;
&lt;P&gt;[&lt;/P&gt;
&lt;P&gt;ID, DATE, DATE_INSERT&lt;/P&gt;
&lt;P&gt;1230,31-dic-09,14/08/2008 13:19&lt;/P&gt;
&lt;P&gt;1230,31-dic-09,01/08/2010 16:13&lt;/P&gt;
&lt;P&gt;1235,14-ago-08,10/08/2008 17:19&lt;/P&gt;
&lt;P&gt;1235,14-ago-08,10/08/2008 16:11&lt;/P&gt;
&lt;P&gt;1236,01-gen-09,02/02/2009 12:18&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tbl_OUTPUT:&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;load &lt;/P&gt;
&lt;P&gt;ID, DATE, DATE_INSERT&lt;/P&gt;
&lt;P&gt;Resident tbl_INPUT&lt;/P&gt;
&lt;P&gt;where ID &amp;lt;&amp;gt; peek(ID)&lt;/P&gt;
&lt;P&gt;order by ID, DATE desc, DATE_INSERT desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table tbl_INPUT;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 19:41:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-of-two-date-fields/m-p/772269#M274005</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-12-21T19:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Max of two date fields</title>
      <link>https://community.qlik.com/t5/QlikView/Max-of-two-date-fields/m-p/772270#M274006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use below script&lt;/P&gt;&lt;P&gt;tbl_INPUT:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(Date#(DATE, 'DD-MMM-YY')) as DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Timestamp#(DATE_INSERT,'DD/MM/YYYY hh:mm') as DATE_INSERT &lt;/P&gt;&lt;P&gt;inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;ID, DATE, DATE_INSERT&lt;/P&gt;&lt;P&gt;1230,31-dec-09,14/08/2008 13:19&lt;/P&gt;&lt;P&gt;1230,31-dec-09,01/08/2010 16:13&lt;/P&gt;&lt;P&gt;1235,14-aug-08,10/08/2008 17:19&lt;/P&gt;&lt;P&gt;1235,14-aug-08,10/08/2008 16:11&lt;/P&gt;&lt;P&gt;1236,01-jan-09,02/02/2009 12:18&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now create a Straight Table&lt;/P&gt;&lt;P&gt;Dimension&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;P&gt;=FirstSortedValue(DATE_INSERT, -Aggr(Date(FirstSortedValue(DATE, -Aggr(Max(DATE),ID))),DATE))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 20:35:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-of-two-date-fields/m-p/772270#M274006</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-12-21T20:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Max of two date fields</title>
      <link>https://community.qlik.com/t5/QlikView/Max-of-two-date-fields/m-p/772271#M274007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or use below &lt;/P&gt;&lt;P&gt;Dimension &lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;P&gt;FirstSortedValue(DISTINCT Aggr(Max(DATE_INSERT),ID,DATE),-DATE)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 20:54:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-of-two-date-fields/m-p/772271#M274007</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-12-21T20:54:17Z</dc:date>
    </item>
  </channel>
</rss>

