<?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: Looking for rows with latest date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167468#M379941</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be one of the following should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({1&amp;lt;DateFld={'$(=Max(DateFld))'}&amp;gt;} ProductID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({1&amp;lt;DateFld={'$(=Max(Date(DateFld,'DD/MM/YYYY')))'}&amp;gt;} ProductID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 May 2016 20:29:44 GMT</pubDate>
    <dc:creator>trdandamudi</dc:creator>
    <dc:date>2016-05-29T20:29:44Z</dc:date>
    <item>
      <title>Looking for rows with latest date</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167466#M379939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that there is a very simple answer to this but I can't find it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following data;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DateFld&lt;/TD&gt;&lt;TD&gt;ProductID&lt;/TD&gt;&lt;TD&gt;BG&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2014-10-28&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2014-10-29&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2014-10-30&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2014-10-31&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2014-11-01&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2014-11-02&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2014-11-02&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to produce a SUM for all rows with the latest date.I have tried the following, but I get an answer of 28:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='Match to last date: ' &amp;amp; Sum( {1&amp;lt;[DateFld] = {"=max(DateFld)"}&amp;gt;}&amp;nbsp; ProductID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said, this gives an answer of 28 which is the SUM(productid) from all rows, not just those for 2014-11-02. So it looks like my MAX function is not going across the entire set - although I've used the '1' in the set analysis. I'm obviously misunderstanding something here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All help much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 16:33:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167466#M379939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-29T16:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for rows with latest date</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167467#M379940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please do not (try to) start the same topic multiple times. I have rejected and deleted your other copy and approved (only) this one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for your question:&lt;/P&gt;&lt;P&gt;I am not completely sure what you are trying to achieve. The sum of an ID field feels weird. You probably want to change that SUM by a Count(distinct ProductID) with some Set Analysis in there.&lt;/P&gt;&lt;P&gt;Can't check for you as I am not behind a PC with QV installed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 19:11:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167467#M379940</guid>
      <dc:creator>oknotsen</dc:creator>
      <dc:date>2016-05-29T19:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for rows with latest date</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167468#M379941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be one of the following should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({1&amp;lt;DateFld={'$(=Max(DateFld))'}&amp;gt;} ProductID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({1&amp;lt;DateFld={'$(=Max(Date(DateFld,'DD/MM/YYYY')))'}&amp;gt;} ProductID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 20:29:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167468#M379941</guid>
      <dc:creator>trdandamudi</dc:creator>
      <dc:date>2016-05-29T20:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for rows with latest date</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167469#M379942</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;&lt;STRONG&gt;='Match to last date: ' &amp;amp; Sum({1&amp;lt;DateFld = {"&lt;SPAN style="color: #ff6600;"&gt;$(&lt;/SPAN&gt;=&lt;SPAN style="color: #99cc00;"&gt;Date(&lt;/SPAN&gt;Max(DateFld)&lt;SPAN style="color: #99cc00;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #ff6600;"&gt;)&lt;/SPAN&gt;"}&amp;gt;}&amp;nbsp; ProductID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. You missed the dollar sign expansion&lt;/P&gt;&lt;P&gt;2. You missed the Date function &lt;A href="https://community.qlik.com/qlik-blogpost/4394"&gt;Dates in Set Analysis&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="126154" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/126154_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 May 2016 21:10:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167469#M379942</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-29T21:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for rows with latest date</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167470#M379943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Onno,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my apologies for breaking the rules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree that 'sum(productid)' doesn't make sense on the face of it, my example has 'morphed' through a couple of changes until I could get down to a very simple example - and I forgot to change the column name!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think of the column as SalesValue instead of ProductID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 08:06:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167470#M379943</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-31T08:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for rows with latest date</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167471#M379944</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;Thanks (again) for your help. As you and others said I missed out the 'S' expansion and adding it allows me to do what I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found that I didn't need the Date function, it seemed to work fine without that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 08:08:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167471#M379944</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-31T08:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for rows with latest date</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167472#M379945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thirumala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, works a treat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 08:09:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167472#M379945</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-31T08:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for rows with latest date</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167473#M379946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure how Max() works sometime, but it is always good to add it to make sure it doesn't betray you another time. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 12:37:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-rows-with-latest-date/m-p/1167473#M379946</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-31T12:37:51Z</dc:date>
    </item>
  </channel>
</rss>

