<?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 MaxDate and Max time selecting the data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150052#M28143</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;what you can also do is to sort your table and use PEEK.&lt;/P&gt;&lt;P&gt;ActualStatus:&lt;BR /&gt;Load&lt;BR /&gt; DocumentNo,&lt;BR /&gt; Date as ActualDate,&lt;BR /&gt; Time as ActualTime,&lt;BR /&gt; Status as ActualStatus&lt;BR /&gt;Resident TempStatus&lt;BR /&gt;Where DocumentNo &amp;lt;&amp;gt; Peek(DocumentNo)&lt;BR /&gt;Order By DocumentNo, Date DESC, Time DESC;&lt;/P&gt;&lt;P&gt;See the attached example.&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jul 2009 14:23:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-23T14:23:38Z</dc:date>
    <item>
      <title>MaxDate and Max time selecting the data</title>
      <link>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150049#M28140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data looks like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 219pt; border-collapse: collapse;" width="292"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 70pt; mso-width-source: userset; mso-width-alt: 3401;" width="93" /&gt;&lt;COL style="width: 48pt;" width="64" /&gt;&lt;COL style="width: 53pt; mso-width-source: userset; mso-width-alt: 2596;" width="71" /&gt;&lt;COL style="width: 48pt;" width="64" /&gt;&lt;/COLGROUP&gt;&lt;TBODY&gt;&lt;TR height="20" style="height: 15pt;"&gt;&lt;TD class="xl63" height="20" style="width: 70pt; height: 15pt; background-color: transparent; border: windowtext 0.5pt solid;" width="93"&gt;DocumentNo&lt;/TD&gt;&lt;TD class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; border-left: windowtext; width: 48pt; border-bottom: windowtext 0.5pt solid; background-color: transparent;" width="64"&gt;Date&lt;/TD&gt;&lt;TD class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; border-left: windowtext; width: 53pt; border-bottom: windowtext 0.5pt solid; background-color: transparent;" width="71"&gt;Time&lt;/TD&gt;&lt;TD class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; border-left: windowtext; width: 48pt; border-bottom: windowtext 0.5pt solid; background-color: transparent;" width="64"&gt;Status&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="20" style="height: 15pt;"&gt;&lt;TD align="right" class="xl63" height="20" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 15pt; background-color: transparent;"&gt;111&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;20090326&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;131022&lt;/TD&gt;&lt;TD class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;STAT1&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="20" style="height: 15pt;"&gt;&lt;TD align="right" class="xl63" height="20" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 15pt; background-color: transparent;"&gt;111&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;20090326&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;130907&lt;/TD&gt;&lt;TD class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;STAT2&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="20" style="height: 15pt;"&gt;&lt;TD align="right" class="xl63" height="20" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 15pt; background-color: transparent;"&gt;111&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;20081123&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;112200&lt;/TD&gt;&lt;TD class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;STAT3&lt;/TD&gt;&lt;/TR&gt;&lt;TR height="20" style="height: 15pt;"&gt;&lt;TD align="right" class="xl63" height="20" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 15pt; background-color: transparent;"&gt;111&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;20081122&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;102000&lt;/TD&gt;&lt;TD class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;STAT4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to find the latest status of the document - that is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 219pt; border-collapse: collapse;" width="292"&gt;&lt;TBODY&gt;&lt;TR height="20" style="height: 15pt;"&gt;&lt;TD align="right" class="xl63" height="20" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 15pt; background-color: transparent;"&gt;111&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;20090326&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;131022&lt;/TD&gt;&lt;TD class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;STAT1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;tmp:&lt;/P&gt;&lt;P&gt;Load * from c:\file.xls;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tmp1:&lt;/P&gt;&lt;P&gt;Load document,&lt;/P&gt;&lt;P&gt;Max(Date) as Udate,&lt;/P&gt;&lt;P&gt;Max(Time) as Utime&lt;/P&gt;&lt;P&gt;resident tmp&lt;/P&gt;&lt;P&gt;group by document ;&lt;/P&gt;&lt;P&gt;is working fine and it is picking only one value.&lt;/P&gt;&lt;P&gt;If I include the Status - it is picking the multiple records.For reporting I would like to show only the Latest value&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 219pt; border-collapse: collapse;" width="292"&gt;&lt;TBODY&gt;&lt;TR height="20" style="height: 15pt;"&gt;&lt;TD align="right" class="xl63" height="20" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext 0.5pt solid; border-bottom: windowtext 0.5pt solid; height: 15pt; background-color: transparent;"&gt;111&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;20090326&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;131022&lt;/TD&gt;&lt;TD class="xl63" style="border-right: windowtext 0.5pt solid; border-top: windowtext; border-left: windowtext; border-bottom: windowtext 0.5pt solid; background-color: transparent;"&gt;STAT1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Is their any way to pickup the max date and time along with status.&lt;/P&gt;&lt;P&gt;Advance thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2009 02:42:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150049#M28140</guid>
      <dc:creator />
      <dc:date>2009-07-23T02:42:32Z</dc:date>
    </item>
    <item>
      <title>MaxDate and Max time selecting the data</title>
      <link>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150050#M28141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's one approach. Load in your table sorting by DocumentNo, then Date and Time descending. Whenever the DocumentNo changes (compare to previous(DocumentNo)), set a flag to 1, else null. Then inner join to an inline table with the flag set to 1. Drop the flag.&lt;/P&gt;&lt;P&gt;There's probably a way to do it in a single load without the inner join, but I'm not thinking of it. I'm probably missing something obvious, and am about to be publically humiliated. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And while it won't cause problems for my proposed approach, note that max(Date) + max(Time) is not the same thing as max(Date + Time). It only works in your example because your times increase along with your dates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2009 03:26:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150050#M28141</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-07-23T03:26:20Z</dc:date>
    </item>
    <item>
      <title>MaxDate and Max time selecting the data</title>
      <link>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150051#M28142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would this work for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load&lt;BR /&gt; date(max(timestamp#(Date &amp;amp; ' ' &amp;amp; Time, 'YYYYMMDD hhmmss'))) as MaxDate,&lt;BR /&gt; time(max(timestamp#(Date &amp;amp; ' ' &amp;amp; Time, 'YYYYMMDD hhmmss'))) as MaxTime,&lt;BR /&gt; maxstring(dual(Status, timestamp#(Date &amp;amp; ' ' &amp;amp; Time, 'YYYYMMDD hhmmss'))) as MaxStatus&lt;BR /&gt;resident tmp&lt;BR /&gt;group by 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2009 03:52:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150051#M28142</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2009-07-23T03:52:14Z</dc:date>
    </item>
    <item>
      <title>MaxDate and Max time selecting the data</title>
      <link>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150052#M28143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;what you can also do is to sort your table and use PEEK.&lt;/P&gt;&lt;P&gt;ActualStatus:&lt;BR /&gt;Load&lt;BR /&gt; DocumentNo,&lt;BR /&gt; Date as ActualDate,&lt;BR /&gt; Time as ActualTime,&lt;BR /&gt; Status as ActualStatus&lt;BR /&gt;Resident TempStatus&lt;BR /&gt;Where DocumentNo &amp;lt;&amp;gt; Peek(DocumentNo)&lt;BR /&gt;Order By DocumentNo, Date DESC, Time DESC;&lt;/P&gt;&lt;P&gt;See the attached example.&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2009 14:23:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150052#M28143</guid>
      <dc:creator />
      <dc:date>2009-07-23T14:23:38Z</dc:date>
    </item>
    <item>
      <title>MaxDate and Max time selecting the data</title>
      <link>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150053#M28144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;John witherspoon wrote:There's probably a way to do it in a single load without the inner join, but I'm not thinking of it. I'm probably missing something obvious, and am about to be publically humiliated. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Rainer Filoda wrote:Where DocumentNo &amp;lt;&amp;gt; Peek(DocumentNo)&lt;/PRE&gt;&lt;BR /&gt;Yeah, there we go. That's the obvious solution I was missing. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 00:13:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150053#M28144</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-07-24T00:13:43Z</dc:date>
    </item>
    <item>
      <title>MaxDate and Max time selecting the data</title>
      <link>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150054#M28145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Rainer Filoda wrote:Where DocumentNo &amp;lt;&amp;gt; Peek(DocumentNo)&lt;BR /&gt;Order By DocumentNo, Date DESC, Time DESC;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Nice solution!&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 05:48:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150054#M28145</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-07-24T05:48:35Z</dc:date>
    </item>
    <item>
      <title>MaxDate and Max time selecting the data</title>
      <link>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150055#M28146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;wow! pretty cool solution Rainer. Thanks for the idea.&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 08:04:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MaxDate-and-Max-time-selecting-the-data/m-p/150055#M28146</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2009-07-24T08:04:58Z</dc:date>
    </item>
  </channel>
</rss>

