<?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 Duplicate Values Problem - Data is accurate but only want to select first result in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Duplicate-Values-Problem-Data-is-accurate-but-only-want-to/m-p/241595#M501539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new to Qlikview and have been getting some problems in trying to manage some invoices which we are pulling out of a database to analyse.&lt;/P&gt;&lt;P&gt;My problem is that we are pulling through invoices that are unique and valid from our database.&lt;/P&gt;&lt;P&gt;The Issue is:-&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;invoices are duplicated as the order can be split up into segments if not all the order is in stock. Therefore our values are inaccurate by however many segments the order is broken down into. (We can't count number of records and divide by that as segments can be different sizes and have a moving exchange rate)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The Solution I am looking for is:-&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I would only like to select the first value from this result (and ignore the rest) but I am unsure how to do this.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fields that are the same are Invoice Number, Invoice Item and Billing date, the field that changes is the condition record.&lt;/P&gt;&lt;P&gt;I am not sure if there is a way in Set Analysis to filter these out, or if there is a way to stop this in the script itelf.&lt;/P&gt;&lt;P&gt;Thanks for any help recieved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Mar 2011 11:05:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-08T11:05:30Z</dc:date>
    <item>
      <title>Duplicate Values Problem - Data is accurate but only want to select first result</title>
      <link>https://community.qlik.com/t5/QlikView/Duplicate-Values-Problem-Data-is-accurate-but-only-want-to/m-p/241595#M501539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new to Qlikview and have been getting some problems in trying to manage some invoices which we are pulling out of a database to analyse.&lt;/P&gt;&lt;P&gt;My problem is that we are pulling through invoices that are unique and valid from our database.&lt;/P&gt;&lt;P&gt;The Issue is:-&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;invoices are duplicated as the order can be split up into segments if not all the order is in stock. Therefore our values are inaccurate by however many segments the order is broken down into. (We can't count number of records and divide by that as segments can be different sizes and have a moving exchange rate)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The Solution I am looking for is:-&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I would only like to select the first value from this result (and ignore the rest) but I am unsure how to do this.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fields that are the same are Invoice Number, Invoice Item and Billing date, the field that changes is the condition record.&lt;/P&gt;&lt;P&gt;I am not sure if there is a way in Set Analysis to filter these out, or if there is a way to stop this in the script itelf.&lt;/P&gt;&lt;P&gt;Thanks for any help recieved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 11:05:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duplicate-Values-Problem-Data-is-accurate-but-only-want-to/m-p/241595#M501539</guid>
      <dc:creator />
      <dc:date>2011-03-08T11:05:30Z</dc:date>
    </item>
    <item>
      <title>Duplicate Values Problem - Data is accurate but only want to select first result</title>
      <link>https://community.qlik.com/t5/QlikView/Duplicate-Values-Problem-Data-is-accurate-but-only-want-to/m-p/241596#M501540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you add a distinct / group by clause in the SQL query at the loading?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Select&lt;BR /&gt;distinct&lt;BR /&gt;Invoice Number, Invoice Item, Billing date&lt;BR /&gt;from table&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Select&lt;BR /&gt;&lt;BR /&gt;Invoice Number, Invoice Item, Billing date&lt;BR /&gt;// add some min / max clause to merge all the lines into 1&lt;BR /&gt;from table&lt;BR /&gt;group by Invoice Number, Invoice Item, Billing date&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;or in Oracle to get only the first line of each Invoice Number, Invoice Item, Billing date (assuming that a field "line_number" allows you to find which is the first&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Select&lt;BR /&gt;Invoice Number, Invoice Item, Billing date&lt;BR /&gt;,min(&amp;lt;attribute1&amp;gt;) keep (dense_rank first order by "line_number") "ATTRIBUTE1_FIRST_LINE"&lt;BR /&gt;,max(&amp;lt;attribute2&amp;gt;) keep (dense_rank first order by "line_number") "ATTRIBUTE2_FIRST_LINE"&lt;BR /&gt;from table&lt;BR /&gt;group by Invoice Number, Invoice Item, Billing date&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 22:21:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duplicate-Values-Problem-Data-is-accurate-but-only-want-to/m-p/241596#M501540</guid>
      <dc:creator>nstefaniuk</dc:creator>
      <dc:date>2011-03-08T22:21:27Z</dc:date>
    </item>
  </channel>
</rss>

