<?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 only first record in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Load-only-first-record/m-p/26847#M188</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First 1 Load * &lt;/P&gt;&lt;P&gt;is this what you mean?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Jan 2018 09:24:27 GMT</pubDate>
    <dc:creator>ali_hijazi</dc:creator>
    <dc:date>2018-01-31T09:24:27Z</dc:date>
    <item>
      <title>Load only first record</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Load-only-first-record/m-p/26845#M186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table which I load in via the following script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[versions]:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[id_u3] AS [id_u3],&lt;/P&gt;&lt;P&gt;[name_u2] AS [name_u2],&lt;/P&gt;&lt;P&gt;[__FK_versions] AS [__KEY_fields]&lt;/P&gt;&lt;P&gt;RESIDENT RestConnectorMasterTable&lt;/P&gt;&lt;P&gt;WHERE NOT IsNull([__FK_versions]) ORDER BY [id_u3];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each &lt;SPAN style="font-size: 13.3333px;"&gt; [id_u3]&lt;/SPAN&gt; have only one &lt;SPAN style="font-size: 13.3333px;"&gt;[name_u2]&lt;/SPAN&gt; but &lt;SPAN style="font-size: 13.3333px;"&gt;[__KEY_fields] can have multiple reccord of couple (&lt;SPAN style="font-size: 13.3333px;"&gt; [id_u3]&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; , &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;[name_u2]): &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Example&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid rgb(0, 0, 0); width: 291px; height: 123px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;[__KEY_fields] &lt;/SPAN&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;id_u3&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;name_u2&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;TEST1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;TEST2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;TEST3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;TEST4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;What I realle need to load in the application for each unique &lt;SPAN style="font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;[__KEY_fields] &lt;/SPAN&gt; is only the couple &lt;SPAN style="font-size: 13.3333px;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; [id_u3]&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; , &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;[name_u2]) where [id_u3] is the smallest value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to create a new table in the load script as follow; but it is in error and impossible to launch data load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[versions1]:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #ff6600;"&gt;FirstSortedValue(id_u3, -Aggr(id_u3, name_u2,[__FK_versions])) as [id_u3],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #ff6600;"&gt;FirstSortedValue(id_u3, -Aggr(id_u3, name_u2,[__FK_versions])) as [name_u2],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;[__FK_versions] AS [__KEY_fields]&lt;/P&gt;&lt;P&gt;RESIDENT [version];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2018 08:56:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Load-only-first-record/m-p/26845#M186</guid>
      <dc:creator>hhajjali</dc:creator>
      <dc:date>2018-01-31T08:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Load only first record</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Load-only-first-record/m-p/26846#M187</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;Check this link.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-6907"&gt;Using FirstSortedValue in the Script&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2018 09:12:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Load-only-first-record/m-p/26846#M187</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2018-01-31T09:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Load only first record</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Load-only-first-record/m-p/26847#M188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First 1 Load * &lt;/P&gt;&lt;P&gt;is this what you mean?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2018 09:24:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Load-only-first-record/m-p/26847#M188</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2018-01-31T09:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Load only first record</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Load-only-first-record/m-p/26848#M189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for replies, &lt;/P&gt;&lt;P&gt;First 1 Load * will only load the first record, it is not really what I need, because I want the first record for each [__KEY_FIELDS].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is using firstsortedvalue, Kaushik's response helped me to figure out how to resolve my problem: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I order my table by &lt;SPAN style="font-size: 13.3333px;"&gt;[__KEY_fields],[id_u7] : &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[versions]:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[id_u7] AS [IDVersion],&lt;/P&gt;&lt;P&gt;[name_u4] AS [TEMPRELEASE],&lt;/P&gt;&lt;P&gt;[__FK_versions] AS [__KEY_fields]&lt;/P&gt;&lt;P&gt;RESIDENT RestConnectorMasterTable&lt;/P&gt;&lt;P&gt;WHERE NOT IsNull([__FK_versions])&lt;/P&gt;&lt;P&gt;order by [__KEY_fields],[id_u7];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I created another table using fisrtsorted value:&lt;/P&gt;&lt;P&gt;[Release]:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;FirstSortedValue([TEMPRELEASE],[IDVersion]) As ARELEASE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [__KEY_fields]&lt;/P&gt;&lt;P&gt;RESIDENT [versions] &lt;/P&gt;&lt;P&gt;Group by [__KEY_fields];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 21:32:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Load-only-first-record/m-p/26848#M189</guid>
      <dc:creator>hhajjali</dc:creator>
      <dc:date>2018-02-02T21:32:57Z</dc:date>
    </item>
  </channel>
</rss>

