<?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: Only loading latest date for a record from an MS Access Database in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Only-loading-latest-date-for-a-record-from-an-MS-Access-Database/m-p/416924#M1153961</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Your earlier post is this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/message/328741#328741"&gt;http://community.qlik.com/message/328741#328741&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isnt this working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Apr 2013 12:59:51 GMT</pubDate>
    <dc:creator>kaushiknsolanki</dc:creator>
    <dc:date>2013-04-03T12:59:51Z</dc:date>
    <item>
      <title>Only loading latest date for a record from an MS Access Database</title>
      <link>https://community.qlik.com/t5/QlikView/Only-loading-latest-date-for-a-record-from-an-MS-Access-Database/m-p/416923#M1153960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I posted a similar question yesterday, I thought I had it nailed. Turns out the combination of not explaining myself properly and gung-honess when it comes to SQL means I didn't get it down properly.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So here it is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had an MS Access Database that I am loading in using ODBC, and using SQL to get the information out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically I'm focusing on a table that deals with the status on a tenant, and their cases with us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what I have to load it all in initially:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13649786334417744" jivemacro_uid="_13649786334417744"&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-family: Courier New;"&gt; 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-family: Courier New;"&gt;'Status_Count'&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;,&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-family: Courier New;"&gt;Comment&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;,&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-family: Courier New;"&gt;`In tenancy`&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;,&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-family: Courier New;"&gt;`Input Date`&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-family: Courier New;"&gt;'Status_Date'&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;,&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-family: Courier New;"&gt;`Referral ID`&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;,&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-family: Courier New;"&gt;Status&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-family: Courier New;"&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;SPAN style="font-size: 8pt;"&gt; SELECT　 Comment,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt; `In tenancy`,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt; `Input Date`,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt; `Referral ID`,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt; Status&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;FROM `tbl_Referral_Status`;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input Date is the date that cases are opened/closed/reopened, the Status is whether they are Closed/Opened/Reopened.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Referral ID is a primary key that links the database together (Each person involved has a unique Ref ID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One persons case can be opened, closed and reopened multiple times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically I want to only load the latest Status of a tenant (Referral ID). If the case was opened on 26/02/2012, then closed on 04/04/2012, and then reopened on 11/09/12, I only want to load in the details for the 11/09/12 (Reopened) status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the monstrosity I have so far (That I stole from an SQL forum and doesn't work, but that may be a syntax thing)&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;'Status_Count'&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;`In tenancy`&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;`Input Date`&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;'Status_Date'&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;`Referral ID`&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Status&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; SELECT &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;`In tenancy`, `Input Date`, `Referral ID`, Status FROM(&lt;BR /&gt;&lt;BR /&gt; SELECT &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;`In tenancy`, `Input Date`, `Referral ID`, Status,&lt;BR /&gt;&lt;BR /&gt; RANK() OVER (PARTITION BY `Referral ID` ORDER BY `Input Date` DESC) status_rank&lt;BR /&gt;&lt;BR /&gt; FROM tbl_Referral_Status&lt;BR /&gt;&lt;BR /&gt; ) WHERE status_rank = 1; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which in theory should do what I want but doesn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wow, sorry for the small essay, but this has been annoying me for 2 days now, and I really poorly explained myself yesterday which means you guys won't be able to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I instead be using a Max(`Input Date`) in the SQL select statement or something? I just don't know at this point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any possible help you can provide.&lt;/P&gt;&lt;P&gt;Joe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 08:53:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-loading-latest-date-for-a-record-from-an-MS-Access-Database/m-p/416923#M1153960</guid>
      <dc:creator />
      <dc:date>2013-04-03T08:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Only loading latest date for a record from an MS Access Database</title>
      <link>https://community.qlik.com/t5/QlikView/Only-loading-latest-date-for-a-record-from-an-MS-Access-Database/m-p/416924#M1153961</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Your earlier post is this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/message/328741#328741"&gt;http://community.qlik.com/message/328741#328741&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isnt this working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 12:59:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-loading-latest-date-for-a-record-from-an-MS-Access-Database/m-p/416924#M1153961</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2013-04-03T12:59:51Z</dc:date>
    </item>
  </channel>
</rss>

