<?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: Load Script - Select Last Value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362765#M134864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Qliksus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your response, the original table will have a lot of records – I assume this won’t be a problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the ‘exist’ statement, are you able to drop the firstsortedvalue() table after you’ve done this? Does it work like a join or more like a where-clause to an external table? Sorry, I’ve never seen it used before &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jun 2012 08:08:27 GMT</pubDate>
    <dc:creator>Dayna</dc:creator>
    <dc:date>2012-06-25T08:08:27Z</dc:date>
    <item>
      <title>Load Script - Select Last Value</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362761#M134860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a set of data that should ideally only have one record with a reference, but unfortunately for some references I get multiple rows (for different dates, etc etc..).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to do in the load script is only pull down the last record based on the highest 'TRANSACTION' for each 'REFERENCE' records. I know if I did it in the application I would do a firstsortedvalue() but no idea how to do it in the load script!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 13:42:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362761#M134860</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2012-06-21T13:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - Select Last Value</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362762#M134861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi u can use the Firstsorted value in the script as well &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the attached file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 07:31:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362762#M134861</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2012-06-22T07:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - Select Last Value</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362763#M134862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Qliksus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any particular reason for doing the firstsortedvalue() in a separate table? As when I do this, it’ll have many fields!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, what does ‘where Exists(Tran,TRANSACTION)’ do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 08:25:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362763#M134862</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2012-06-22T08:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - Select Last Value</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362764#M134863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dyana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the late reply i have used Firstsortedvalue in seperate table bcoz u want to take one tansaction for each reference so you have to group by only the referene column u should not include other columns bcoz that wont give you a single value . Thats y i have used that in a seperate table and then the exists command will load only the last Transaction for each reference&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jun 2012 08:59:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362764#M134863</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2012-06-23T08:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - Select Last Value</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362765#M134864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Qliksus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your response, the original table will have a lot of records – I assume this won’t be a problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the ‘exist’ statement, are you able to drop the firstsortedvalue() table after you’ve done this? Does it work like a join or more like a where-clause to an external table? Sorry, I’ve never seen it used before &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 08:08:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362765#M134864</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2012-06-25T08:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - Select Last Value</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362766#M134865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Qliksus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you also explain why you use ‘FirstSortedValue(TRANSACTION,-REFERENCE)’ and not ‘FirstSortedValue(REFERENCE,-TRANSACTION)’? I would of always done the latter as it’s the last TRANSACTION number I want for each REFERENCE, so I’m struggling to get my head round it! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 08:20:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362766#M134865</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2012-06-25T08:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - Select Last Value</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362767#M134866</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;What u specify in the expression will be returned that is the first column u are giving will be returned based on the &lt;/P&gt;&lt;P&gt;sort weight so if u want to take the last value of the transaction u have to give that in the expression i think i understood it other way around so thats y i have done that way &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 05:32:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362767#M134866</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2012-06-27T05:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - Select Last Value</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362768#M134867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you drop the exists table no data will be there i have used this because using a exitsis better than using the keyword&amp;nbsp; LEFT JOIN&amp;nbsp; between the tables bcoz try to avoid the join keyword in the script when you go through qlikview help &lt;/P&gt;&lt;P&gt;u will find the below reason&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The explicit &lt;A class="MCXref_0" href="http://mce_host/message/mk:@MSITStoreC\PROGRA~1\QlikView\English.chm::"&gt;&lt;EM&gt;Join&lt;/EM&gt;&lt;/A&gt; keyword in QlikView script language performs a full join of the two tables. The result is one table. In many cases such joins will result in very large tables. One of the main features of QlikView is its ability to make associations between tables instead of joining them, which greatly reduces memory usage, increases processing speed and offers enormous flexibility. Explicit joins should therefore be generally avoided in QlikView scripts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 05:44:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362768#M134867</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2012-06-27T05:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script - Select Last Value</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362769#M134868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, thank you for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 15:38:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Select-Last-Value/m-p/362769#M134868</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2012-06-27T15:38:07Z</dc:date>
    </item>
  </channel>
</rss>

