<?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 Return first record per part only. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269386#M707453</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a Part table. Our system allows you to attach a drawing to a part record, and this is stores in another table. You are able to attach more than one drawing to each part, hence creating a one to many link. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I tell qlikview to only return the first record per part? IE if one part has 2 drawings I only want to have the first found drawing to be returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Would doing something like this work? I would apply the same formula to all fields so if the previous record is the same part (IE this is the second attachment) it would return null values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(peek(partnum)=partnum,null(),partnum) as part&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Nov 2011 19:50:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-11-30T19:50:02Z</dc:date>
    <item>
      <title>Return first record per part only.</title>
      <link>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269386#M707453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a Part table. Our system allows you to attach a drawing to a part record, and this is stores in another table. You are able to attach more than one drawing to each part, hence creating a one to many link. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I tell qlikview to only return the first record per part? IE if one part has 2 drawings I only want to have the first found drawing to be returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Would doing something like this work? I would apply the same formula to all fields so if the previous record is the same part (IE this is the second attachment) it would return null values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(peek(partnum)=partnum,null(),partnum) as part&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 19:50:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269386#M707453</guid>
      <dc:creator />
      <dc:date>2011-11-30T19:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Return first record per part only.</title>
      <link>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269387#M707454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same basic idea, but I might do something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(peek(partnum)&amp;lt;&amp;gt;partnum,'Y') as Keep&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then use a preceding load with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHERE Keep = 'Y'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 22:26:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269387#M707454</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-11-30T22:26:17Z</dc:date>
    </item>
    <item>
      <title>Return first record per part only.</title>
      <link>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269388#M707455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;would the where be in the load, or the select section?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(peek(partnum)&amp;lt;&amp;gt;partnum,'Y') as Keep&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WhereKeep='Y';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Select &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;From ...;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;or &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(peek(partnum)&amp;lt;&amp;gt;partnum,'Y') as Keep;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Select &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;From ... Where Keep='Y';&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 12:15:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269388#M707455</guid>
      <dc:creator />
      <dc:date>2011-12-01T12:15:45Z</dc:date>
    </item>
    <item>
      <title>Return first record per part only.</title>
      <link>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269389#M707456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;Hi,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Your code should be as follows ( as suggested by John &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Load&amp;nbsp; *&amp;nbsp; where Keep='Y';&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Load&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;*,&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;if(peek(partnum)&amp;lt;&amp;gt;partnum,'Y') as Keep;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Select&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;From ...;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;-Sridhar&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 13:34:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269389#M707456</guid>
      <dc:creator>sridhar240784</dc:creator>
      <dc:date>2011-12-01T13:34:40Z</dc:date>
    </item>
    <item>
      <title>Return first record per part only.</title>
      <link>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269390#M707457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I finally got it to work using your help. It was not loading the data according to the part so I had to use a resident table with Order by. Seems to be working correctly now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 14:17:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-first-record-per-part-only/m-p/269390#M707457</guid>
      <dc:creator />
      <dc:date>2011-12-01T14:17:03Z</dc:date>
    </item>
  </channel>
</rss>

