<?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: Last Contact per Customer in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066840#M466635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert, Thanks... that works... not sure, though, why the data model didn't work on some of those...like: &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;aggr( max(Contact_Date), Salesman_ID, Customer_ID)&lt;/LI&gt;&lt;LI&gt;If (Contact_Date = aggr( max(Contact_Date), Salesman_ID, Customer_ID), date(Contact_Date), null())&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;But thanks, your method worked...&lt;/P&gt;&lt;P&gt; Jarrell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jan 2016 19:58:05 GMT</pubDate>
    <dc:creator>jrdunson</dc:creator>
    <dc:date>2016-01-25T19:58:05Z</dc:date>
    <item>
      <title>Last Contact per Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066838#M466633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone&lt;/P&gt;&lt;P&gt;How do we find the latest date (max Contact_Date) , for each salesman,.per customer (and show other columns).&amp;nbsp; For example, I want to take this data... (see Sheet1 in attached spreadsheet) [ I also will need min Contact_Date also)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="112490" alt="raw_data.JPG" class="jive-image image-1" height="285" src="https://community.qlik.com/legacyfs/online/112490_raw_data.JPG" style="height: 285px; width: 472.46px;" width="473" /&gt;&lt;/P&gt;&lt;P&gt;And come up with this&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="112491" alt="lastest_contact_sample.JPG" class="jive-image image-2" height="123" src="https://community.qlik.com/legacyfs/online/112491_lastest_contact_sample.JPG" style="height: 123.013px; width: 588px;" width="588" /&gt;&lt;/P&gt;&lt;P&gt;Simple put:&amp;nbsp; group by Salesman_ID, Customer_ID... find max/min contact dates... and show the comments field [though I probably need the record_no too... that is, if there are two records, each with the same max dates, show only one row...so &lt;SPAN style="font-size: 13.3333px;"&gt;group by Salesman_ID, Customer_ID...+ max(rec_no) ...presuming the max rec_no is the last entered, etc.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried the&lt;STRONG&gt; Aggr()&lt;/STRONG&gt; function and &lt;STRONG&gt;FirstSortedValue&lt;/STRONG&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp; I can find the max date, but haven't worked out how to show only the row with the max date... I'll keep trying, but any help would be appreciated...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some attempts:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;aggr( max(Contact_Date), Salesman_ID, Customer_ID)&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;If (Contact_Date = aggr( max(Contact_Date), Salesman_ID, Customer_ID), date(Contact_Date), null())&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;... or use max(aggr( max(Contact_Date), Salesman_ID, Customer_ID)) &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;sum( if(Contact_Date = aggr( max(Contact_Date), Salesman_ID, Customer_ID), 1))&lt;/LI&gt;&lt;LI&gt;FirstSortedValue .. but for two dimensions?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is a sample qvw, MS Word Description file, and Sample spreadsheet.&lt;/P&gt;&lt;P&gt;Thanks ahead of time.&lt;/P&gt;&lt;P&gt;Jarrell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 18:05:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066838#M466633</guid>
      <dc:creator>jrdunson</dc:creator>
      <dc:date>2016-01-25T18:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Last Contact per Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066839#M466634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use only Salesman_ID and Customer_ID as dimensions and as expressions&lt;/P&gt;&lt;P&gt;RecordNo: FirstSortedValue(RecordNo, -Contact_Date)&lt;/P&gt;&lt;P&gt;Comments: FirstSortedValue(Comment, -Contact_Date)&lt;/P&gt;&lt;P&gt;Contact_Date: Max(Contact_Date)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 18:24:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066839#M466634</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-01-25T18:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Last Contact per Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066840#M466635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert, Thanks... that works... not sure, though, why the data model didn't work on some of those...like: &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;aggr( max(Contact_Date), Salesman_ID, Customer_ID)&lt;/LI&gt;&lt;LI&gt;If (Contact_Date = aggr( max(Contact_Date), Salesman_ID, Customer_ID), date(Contact_Date), null())&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;But thanks, your method worked...&lt;/P&gt;&lt;P&gt; Jarrell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 19:58:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066840#M466635</guid>
      <dc:creator>jrdunson</dc:creator>
      <dc:date>2016-01-25T19:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Last Contact per Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066841#M466636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If Gysbert's responses helped you get the correct answer, I would suggest marking his response as the correct answer (&lt;A href="https://community.qlik.com/docs/DOC-14806"&gt;Qlik Community Tip: Marking Replies as Correct or Helpful&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 20:00:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066841#M466636</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-01-25T20:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Last Contact per Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066842#M466637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;done &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 20:34:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066842#M466637</guid>
      <dc:creator>jrdunson</dc:creator>
      <dc:date>2016-01-25T20:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Last Contact per Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066843#M466638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 20:37:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Contact-per-Customer/m-p/1066843#M466638</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-01-25T20:37:42Z</dc:date>
    </item>
  </channel>
</rss>

