<?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 Script / Loading first value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Loading-first-value/m-p/305451#M706756</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;I'm trying to load, for all of my customers, the first date they ordered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables which are basically as following :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ORDERS :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;order_id,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_id,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;order_date,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;order_turnover&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;FROM QVD/orders.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;CUSTOMERS :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_id,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_name,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_registration_date&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;FROM QVD/customers.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to add a column in my "CUSTOMERS" table which would be the first order date (i want it to be pre-calculated in the script, not calculated within the report).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Damien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jan 2012 13:16:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-01-25T13:16:29Z</dc:date>
    <item>
      <title>Script / Loading first value</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Loading-first-value/m-p/305451#M706756</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;I'm trying to load, for all of my customers, the first date they ordered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables which are basically as following :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ORDERS :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;order_id,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_id,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;order_date,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;order_turnover&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;FROM QVD/orders.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;CUSTOMERS :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;LOAD&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_id,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_name,&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;customer_registration_date&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;FROM QVD/customers.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to add a column in my "CUSTOMERS" table which would be the first order date (i want it to be pre-calculated in the script, not calculated within the report).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Damien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2012 13:16:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Loading-first-value/m-p/305451#M706756</guid>
      <dc:creator />
      <dc:date>2012-01-25T13:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script / Loading first value</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Loading-first-value/m-p/305452#M706757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try a grouped by load with FirstSortedValue aggregation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join (CUSTOMERS) LOAD&lt;/P&gt;&lt;P&gt;customer_id,&lt;/P&gt;&lt;P&gt;FirstSortedValue(order_date, order_date) as FirstOrderDate&lt;/P&gt;&lt;P&gt;resident ORDERS group by customer_id;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to your script, after the above posted lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that order_date is of Date type with numerical representation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2012 13:22:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Loading-first-value/m-p/305452#M706757</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-01-25T13:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Script / Loading first value</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Loading-first-value/m-p/305453#M706758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much ! It works perfectly !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2012 15:05:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Loading-first-value/m-p/305453#M706758</guid>
      <dc:creator />
      <dc:date>2012-01-25T15:05:52Z</dc:date>
    </item>
  </channel>
</rss>

