<?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: FirstSortedValue with date,  and multiple dimensions. GIve unknown error in script - load. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718815#M724421</link>
    <description>&lt;P&gt;That did the trick, I just need to do it on all of the dimensions.&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jun 2020 11:51:45 GMT</pubDate>
    <dc:creator>varmekontrol</dc:creator>
    <dc:date>2020-06-15T11:51:45Z</dc:date>
    <item>
      <title>FirstSortedValue with date,  and multiple dimensions. GIve unknown error in script - load.</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718190#M724417</link>
      <description>&lt;P&gt;So I think I have studied all subjects I could find on this topic, and the closest I got to a solution was this answer from the always helpful Sunny_talwar -&amp;gt;&amp;nbsp;&lt;A href="https://community.qlik.com/t5/New-to-Qlik-Sense/Firstsortedvalue-not-working-in-Load-Script-on-QlikSense/td-p/79065" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/New-to-Qlik-Sense/Firstsortedvalue-not-working-in-Load-Script-on-QlikSense/td-p/79065&amp;nbsp;&lt;/A&gt;&lt;BR /&gt;Here I found out that all dimensions needed to be in the &lt;STRONG&gt;Group By statement.&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;This is what I am trying to do:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only load the lates records, determined by the &lt;STRONG&gt;period_end&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Property_list:
LOAD 
     admin_id, 
     property_no, 
     property_name, 
     FirstSortedValue(works_id, -period_end) as works_id,
     period_end
     
FROM
[C:\Temp\File_$(vFileName)]
(txt, utf8, embedded labels, delimiter is ';', msq) Group By admin_id, property_no, property_name, works_id, period_end;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This is my result, where the records for multiple &lt;STRONG&gt;period&amp;nbsp;_end&lt;/STRONG&gt; still exists.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 588px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/35424iD58B7C9409235D9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:29:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718190#M724417</guid>
      <dc:creator>varmekontrol</dc:creator>
      <dc:date>2024-11-16T00:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with date,  and multiple dimensions. GIve unknown error in script - load.</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718221#M724418</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6298"&gt;@varmekontrol&lt;/a&gt;&amp;nbsp;here you have grouped by all dimensions, that's why the output will keep all rows Max of a row is a row, if I understood well you need :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Property_list:
LOAD 
     admin_id, 
     property_no, 
     property_name, 
     FirstSortedValue(works_id, -period_end) as works_id,
     period_end
     
FROM
[C:\Temp\File_$(vFileName)]
(txt, utf8, embedded labels, delimiter is ';', msq) Group By admin_id, property_no, property_name;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;otherwise you can share a sample data with the output to propose something else.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 09:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718221#M724418</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-06-12T09:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with date,  and multiple dimensions. GIve unknown error in script - load.</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718264#M724419</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;LOAD * INLINE [
admin_id,	property_no,	property_name,	works_id,	period_end
251359,		7376345039,		Property_1,		555334,		31-05-2020
251324,		20964,			Prop,			232323,		31-05-2019
251359,		7376345039,		Property_1,		555334,		31-05-2019
251359,		7376345039,		Property_1,		555334,		31-05-2019
251359,		7376345039,		Property_1,		555334,		31-05-2018
2515,		4047306875,		Prop,			1323,		31-05-2020
2514,		12132397,		Prop,			23324,		31-05-2020
25111,		1402539578,		Prop,			44456,		31-05-2019
25123,		4047306875,		Prop,			2134234,	31-05-2021
];
Property_list:
LOAD 
     admin_id, 
     property_no, 
     property_name, 
     FirstSortedValue(works_id, -period_end) as works_id,
     period_end
     
FROM
[C:\Temp\File_$(vFileName)]
(txt, utf8, embedded labels, delimiter is ';', msq) Group By admin_id, property_no, property_name;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is some data to help you, sorry for the lack of it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here you can see that the &lt;STRONG&gt;admin_id 251359&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;is present multiple times, because of different dates in&amp;nbsp;&lt;STRONG&gt;period_end&lt;BR /&gt;&lt;/STRONG&gt;I would like to only keep one record, that is the record were the latest &lt;STRONG&gt;period_end&lt;/STRONG&gt; is &lt;STRONG&gt;31-05-2020&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 12:13:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718264#M724419</guid>
      <dc:creator>varmekontrol</dc:creator>
      <dc:date>2020-06-12T12:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with date,  and multiple dimensions. GIve unknown error in script - load.</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718272#M724420</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6298"&gt;@varmekontrol&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there's something missing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; but based to what u share, one solution :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data:
LOAD * INLINE [
admin_id,	property_no,property_name,	period_end
251359,		7376345039,	Property_1,		31-05-2020
251324,		20964,		Prop,			31-05-2019
251359,		7376345039,	Property_1,		31-05-2019
251359,		7376345039,	Property_1,		31-05-2019
251359,		7376345039,	Property_1,		31-05-2018
2515,		4047306875,	Prop,			31-05-2020
2514,		12132397,	Prop,			31-05-2020
25111,		1402539578,	Prop,			31-05-2019
25123,		4047306875,	Prop,			31-05-2021
];

Property_list:
noconcatenate
load admin_id,FirstSortedValue(period_end,-Date#(period_end,'DD-MM-YYYY')) as period_end,FirstSortedValue(property_no,-Date#(period_end,'DD-MM-YYYY')) as property_no,FirstSortedValue(property_name,-Date#(period_end,'DD-MM-YYYY')) as property_name 

resident Data Group by admin_id;


drop table Data;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/35444i121C17C5F8744124/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 12:27:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718272#M724420</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-06-12T12:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with date,  and multiple dimensions. GIve unknown error in script - load.</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718815#M724421</link>
      <description>&lt;P&gt;That did the trick, I just need to do it on all of the dimensions.&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 11:51:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-date-and-multiple-dimensions-GIve-unknown/m-p/1718815#M724421</guid>
      <dc:creator>varmekontrol</dc:creator>
      <dc:date>2020-06-15T11:51:45Z</dc:date>
    </item>
  </channel>
</rss>

