<?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: Script to load the first sorted instance of a record in Scalability</title>
    <link>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785790#M716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As with all aggregating in the script, any expression not in the GROUP BY requires some aggregation function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternative would be breaking it into multiple steps, like loading the original table, then doing a resident load with ORDER BY and use an inter record functions like Peek to create an indicator or flag on the latest row per customer. Lastly you can do a resident load of that table WHERE the indicator or flag value is for the latest row, or just inner join an inline table containing only the desired flag or indicator value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 04:20:23 GMT</pubDate>
    <dc:creator>msteedle</dc:creator>
    <dc:date>2015-01-14T04:20:23Z</dc:date>
    <item>
      <title>Script to load the first sorted instance of a record</title>
      <link>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785787#M713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am trying to figure out a way to load the first instance of duplicated data in my script. I will then use this data to join to another set of data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g,&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Customer&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Cummulative Sum&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Date&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333339691162px;"&gt;28/12/14&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;40&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333339691162px;"&gt;20/12/14&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333339691162px;"&gt;17/12/14&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333339691162px;"&gt;15/12/14&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/12/14&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I want only one instance of customer a which would be the latest sorted date where sum would equal to 50 and data would be 28/12/14.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think in Teradata, I would have the following at the end of my SQL&lt;/P&gt;&lt;P&gt;qualify rownumber() over( partition by customer, cummulative order by date)=1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 00:35:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785787#M713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-14T00:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script to load the first sorted instance of a record</title>
      <link>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785788#M714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;FirstSortedValue&lt;/EM&gt; is an aggregation function you can use in the script to do just this, grouped by Customer, in your example. The example in the QV Desktop help for that function is very similar to what you are doing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 00:50:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785788#M714</guid>
      <dc:creator>msteedle</dc:creator>
      <dc:date>2015-01-14T00:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Script to load the first sorted instance of a record</title>
      <link>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785789#M715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply, so basically, I need to have this function at every column that I don't group with&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 04:09:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785789#M715</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-14T04:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script to load the first sorted instance of a record</title>
      <link>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785790#M716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As with all aggregating in the script, any expression not in the GROUP BY requires some aggregation function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternative would be breaking it into multiple steps, like loading the original table, then doing a resident load with ORDER BY and use an inter record functions like Peek to create an indicator or flag on the latest row per customer. Lastly you can do a resident load of that table WHERE the indicator or flag value is for the latest row, or just inner join an inline table containing only the desired flag or indicator value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 04:20:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785790#M716</guid>
      <dc:creator>msteedle</dc:creator>
      <dc:date>2015-01-14T04:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script to load the first sorted instance of a record</title>
      <link>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785791#M717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sense, will give this a shot, thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 04:22:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Scalability/Script-to-load-the-first-sorted-instance-of-a-record/m-p/785791#M717</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-14T04:22:27Z</dc:date>
    </item>
  </channel>
</rss>

