<?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 Records with the max date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1518994#M748979</link>
    <description>&lt;P&gt;Hello, I hope for your help within this topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have a table with the price records, where the end date is vital for me.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Example.jpg" style="width: 405px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1904i518DAC4DE4238B45/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example.jpg" alt="Example.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Due to behaviour of my database, the date 01.01.1753 means that there is no end date, therefore this date 01.01.1753 is logicaly larger than any other date like 14.07.2018.&lt;/P&gt;&lt;P&gt;I need to remove all records which are not actual. This mean that if a device with a certain type have many records, I have to keep only one the record with the latest end date (where 01.01.1753 is the lates one).&lt;/P&gt;&lt;P&gt;The result have to be like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;SPAN class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Result.jpg" style="width: 405px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1906iBF3C9B14ACDBE707/image-size/large?v=v2&amp;amp;px=999" role="button" title="Result.jpg" alt="Result.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;SPAN class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below"&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I can't find the necessary logic in qlik myself&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;SPAN class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below"&gt;Thank you in advance&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 05:00:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T05:00:08Z</dc:date>
    <item>
      <title>Records with the max date</title>
      <link>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1518994#M748979</link>
      <description>&lt;P&gt;Hello, I hope for your help within this topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have a table with the price records, where the end date is vital for me.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Example.jpg" style="width: 405px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1904i518DAC4DE4238B45/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example.jpg" alt="Example.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Due to behaviour of my database, the date 01.01.1753 means that there is no end date, therefore this date 01.01.1753 is logicaly larger than any other date like 14.07.2018.&lt;/P&gt;&lt;P&gt;I need to remove all records which are not actual. This mean that if a device with a certain type have many records, I have to keep only one the record with the latest end date (where 01.01.1753 is the lates one).&lt;/P&gt;&lt;P&gt;The result have to be like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;SPAN class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Result.jpg" style="width: 405px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1906iBF3C9B14ACDBE707/image-size/large?v=v2&amp;amp;px=999" role="button" title="Result.jpg" alt="Result.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;SPAN class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below"&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I can't find the necessary logic in qlik myself&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;SPAN class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below"&gt;Thank you in advance&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:00:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1518994#M748979</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T05:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Records with the max date</title>
      <link>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1519015#M748980</link>
      <description>&lt;P&gt;I have a solution. maybe there is a smarter solution&lt;BR /&gt;but interesting Interpretation of latest date (1.1.1753)&lt;/P&gt;&lt;P&gt;My solution consists of&amp;nbsp;4 steps:&lt;BR /&gt;1) load data with actual data (1.1.1753)&lt;BR /&gt;2) load contract &amp;amp; type which had not been loaded in previous step and Group by max(Enddate)&lt;BR /&gt;3) add addtional data like STartedate and Price by left join&lt;BR /&gt;4) concatenate results&lt;/P&gt;&lt;P&gt;My results equals to your final table&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;TESTABC:&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="2"&gt;load&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt; * &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;Inline&lt;/FONT&gt; &lt;FONT color="#800000" size="2"&gt;[&lt;BR /&gt;Contract, Type, Start, End, Price&lt;BR /&gt;1, C-A, 14.07.2014, 01.01.1753, 45&lt;BR /&gt;1, C-C, 18.04.2017, 30.04.2017, 45&lt;BR /&gt;1, C-C, 01.05.2017, 01.01.1753,0&lt;BR /&gt;1, C-P, 20.11.2014, 30.04.2016, 65&lt;BR /&gt;1,C-P, 01.05.2016, 31.12.2016, 0&lt;BR /&gt;]&lt;/FONT&gt;&lt;FONT size="2"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#008000" size="2"&gt;// first get dates with actual data&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;TESTDEF:&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="2"&gt;load&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Contract&lt;/FONT&gt;&lt;FONT size="2"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Type&lt;/FONT&gt; &lt;FONT color="#0000ff" size="2"&gt;as&lt;/FONT&gt; &lt;FONT color="#800000" size="2"&gt;%Key&lt;/FONT&gt;&lt;FONT size="2"&gt;,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Contract&lt;/FONT&gt;&lt;FONT size="2"&gt;,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Type&lt;/FONT&gt;&lt;FONT size="2"&gt;,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Start&lt;/FONT&gt;&lt;FONT size="2"&gt;,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;End&lt;/FONT&gt;&lt;FONT size="2"&gt;,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Price&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;Resident&lt;/FONT&gt;&lt;FONT size="2"&gt; TESTABC&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;where&lt;/FONT&gt; &lt;FONT color="#800000" size="2"&gt;End&lt;/FONT&gt;&lt;FONT size="2"&gt;='01.01.1753';&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#008000" size="2"&gt;// next get data with contract and keys which have no actual data&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;TESTXYZ:&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;noConcatenate&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="2"&gt;load&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Contract&lt;/FONT&gt;&lt;FONT size="2"&gt;,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Type&lt;/FONT&gt;&lt;FONT size="2"&gt;,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;max&lt;/FONT&gt;&lt;FONT size="2"&gt;(&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;End&lt;/FONT&gt;&lt;FONT size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;as&lt;/FONT&gt; &lt;FONT color="#800000" size="2"&gt;End&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;Resident&lt;/FONT&gt;&lt;FONT size="2"&gt; TESTABC&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;where&lt;/FONT&gt; &lt;FONT color="#0000ff" size="2"&gt;not&lt;/FONT&gt; &lt;FONT color="#0000ff" size="2"&gt;exists&lt;/FONT&gt;&lt;FONT size="2"&gt; (&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;%Key&lt;/FONT&gt;&lt;FONT size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Contract&lt;/FONT&gt;&lt;FONT size="2"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Type&lt;/FONT&gt;&lt;FONT size="2"&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;group&lt;/FONT&gt; &lt;FONT color="#0000ff" size="2"&gt;by&lt;/FONT&gt; &lt;FONT color="#800000" size="2"&gt;Contract&lt;/FONT&gt;&lt;FONT size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#800000" size="2"&gt;Type&lt;/FONT&gt;&lt;FONT size="2"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#008000" size="2"&gt;// combine remaining fields&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;left&lt;/FONT&gt; &lt;FONT color="#0000ff" size="2"&gt;join&lt;/FONT&gt;&lt;FONT size="2"&gt;(TESTXYZ)&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="2"&gt;load&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt; *&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;Resident&lt;/FONT&gt;&lt;FONT size="2"&gt; TESTABC;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#008000" size="2"&gt;// append to actual data&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;Concatenate&lt;/FONT&gt;&lt;FONT size="2"&gt; (TESTDEF)&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="2"&gt;load&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt; *&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;Resident&lt;/FONT&gt;&lt;FONT size="2"&gt; TESTXYZ;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="2"&gt;drop&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" size="2"&gt;table&lt;/FONT&gt;&lt;FONT size="2"&gt; TESTXYZ;&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="2"&gt;drop&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" size="2"&gt;table&lt;/FONT&gt;&lt;FONT size="2"&gt; TESTABC;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 08:13:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1519015#M748980</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-11T08:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Records with the max date</title>
      <link>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1519056#M748981</link>
      <description>&lt;P&gt;Help you for your answer.&lt;/P&gt;&lt;P&gt;Yes, such logic is in MS Dynamics 5 (to be more precise the value is&amp;nbsp;01.01.1753 0:00:00)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunatelly,&amp;nbsp;this code gives missmatched results:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Help_Result.jpg" style="width: 422px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1944i3190F867E8CCB9EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Help_Result.jpg" alt="Help_Result.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;.. and to be honest, I don't get the whole your logic (%key constraction is totally unknows for me ).&lt;/P&gt;&lt;P&gt;Will look for qlik FAQ&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 09:03:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1519056#M748981</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-11T09:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Records with the max date</title>
      <link>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1519198#M748982</link>
      <description>&lt;P&gt;Hi Ruslans,&lt;/P&gt;&lt;P&gt;May be try this:&lt;/P&gt;&lt;P&gt;A:&lt;BR /&gt;Load&lt;BR /&gt;Contract,&lt;BR /&gt;Type,&lt;BR /&gt;date(Date#(StDate,'DD.MM.YYYY'),'DD.MM.YYYY') as StDate,&lt;BR /&gt;date(Date#(EndDate,'DD.MM.YYYY'),'DD.MM.YYYY') as EndDate,&lt;BR /&gt;Price;&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Contract, Type, StDate, EndDate, Price&lt;BR /&gt;A, 11, 14.07.2014, 01.01.1753, 45&lt;BR /&gt;A, 22, 28.04.2017, 30.04.2017, 45&lt;BR /&gt;A, 22, 01.05.2017, 01.01.1753, 0&lt;BR /&gt;A, 33, 20.11.2014, 30.04.2016, 65&lt;BR /&gt;A, 33, 01.05.2016, 31.12.2016, 0&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;B:&lt;BR /&gt;Load&lt;BR /&gt;Contract&amp;amp; Type as Key3,&lt;BR /&gt;Contract,&lt;BR /&gt;Type,&lt;BR /&gt;StDate,&lt;BR /&gt;EndDate,&lt;BR /&gt;Price&lt;BR /&gt;Resident A&lt;BR /&gt;where match(EndDate,'01.01.1753');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NoConcatenate&lt;BR /&gt;C:&lt;BR /&gt;Load&lt;BR /&gt;Key,&lt;BR /&gt;Key&amp;amp;EndDate as Key2;&lt;BR /&gt;Load&lt;BR /&gt;Contract&amp;amp;Type as Key,&lt;BR /&gt;Date(Max(EndDate),'DD.MM.YYYY') as EndDate&lt;BR /&gt;Resident A&lt;BR /&gt;where not match(EndDate,'01.01.1753')&lt;BR /&gt;Group by Contract&amp;amp; Type;&lt;/P&gt;&lt;P&gt;inner join&lt;BR /&gt;Load&lt;BR /&gt;Contract&amp;amp;Type&amp;amp;EndDate as Key2,&lt;BR /&gt;Contract,&lt;BR /&gt;Type,&lt;BR /&gt;StDate,&lt;BR /&gt;EndDate,&lt;BR /&gt;Price&lt;BR /&gt;Resident A&lt;BR /&gt;where not match(EndDate,'01.01.1753');&lt;BR /&gt;Drop table A;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;E:&lt;BR /&gt;Load&lt;BR /&gt;*&lt;BR /&gt;resident B;&lt;BR /&gt;Concatenate&lt;BR /&gt;Load&lt;BR /&gt;*&lt;BR /&gt;resident C&lt;BR /&gt;where Not Exists(Key3,Key);&lt;BR /&gt;drop Table C;&lt;BR /&gt;Drop Table B;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 268px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1963iE728C07FCF911861/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 11:24:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1519198#M748982</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2018-12-11T11:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Records with the max date</title>
      <link>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1519253#M748983</link>
      <description>&lt;P&gt;This is a bit tricky but you could solve it with an if else statement in an expression and then aggr by Type.. but that can result in slow performance if your data set is large. Better then to use set analysis and create two mutual exclusive parts within the same aggr expression:&lt;/P&gt;&lt;P&gt;=aggr(max({&amp;lt;Type={"=[End date]&amp;lt;&amp;gt;'01.01.1753'"}&amp;gt;} &lt;SPAN&gt;[End date]&lt;/SPAN&gt;) &amp;amp; only({&amp;lt;Type={"=[End date]='&lt;SPAN&gt;01.01.1753&lt;/SPAN&gt;'"}&amp;gt;} &lt;SPAN&gt;[End date]&lt;/SPAN&gt;),Type)&lt;/P&gt;&lt;P&gt;The max and only part within the aggr will neither be valid at the same time so the "&amp;amp;" will concatenate our desired result with an empty string depending on the value of &lt;SPAN&gt;[End date]&lt;/SPAN&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 12:27:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Records-with-the-max-date/m-p/1519253#M748983</guid>
      <dc:creator>kjhertz</dc:creator>
      <dc:date>2018-12-11T12:27:26Z</dc:date>
    </item>
  </channel>
</rss>

