<?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 Remove rows- Duplicate OrderID, Unique ProductID in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548369#M744621</link>
    <description>&lt;P&gt;I am working with an excel file that contains OrderID's and ProductID's, among various other fields. I need to delete ALL ORDERS that contain one of three products (we'll call them Products AA, BB, and CC for now). The issue here is that there are multiple rows for each OrderID, and the only thing making each row unique is the ProductID it lists. Below is a very simplified version of what I mean:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 2019-02-23 at 2.02.03 PM.png" style="width: 193px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6638i4ABC013F47F377C9/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screen Shot 2019-02-23 at 2.02.03 PM.png" alt="Screen Shot 2019-02-23 at 2.02.03 PM.png" /&gt;&lt;/span&gt;This is as far as I've gotten so far- before loading the file into Qlik Sense, I added a column in excel called "Exclusions" where each row shows 0 or 1 depending on whether or not the ProductID for that row is AA, BB, or CC. Once the file was uploaded via the Data Load Editor, I loaded a new table that aggregated all the "Exclusion" values as grouped by OrderID. This successfully assigned each OrderID an OrderSum of 0 if it needed to be kept in the data. Beyond this, I have no clue what to do. I've tried just about every Join, Keep, Select, Mapping, or Load statement I could possibly find. Nothing has worked in any form, however simple or complicated the proposed solution. Pasted below is what HAS worked, i.e. everything up to the aggregated scores:&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quantity,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cost,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; marginP,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; margin2,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EmployeeID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exclusion&lt;BR /&gt;FROM [lib://Data/Sales.xls]&lt;BR /&gt;(biff, embedded labels, table is Orders$);&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;SumTable$:&lt;BR /&gt;LOAD OrderID, Sum(Exclusion) as OrderSum Resident Orders$ Group By OrderID;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>ellensadler</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Remove rows- Duplicate OrderID, Unique ProductID</title>
      <link>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548369#M744621</link>
      <description>&lt;P&gt;I am working with an excel file that contains OrderID's and ProductID's, among various other fields. I need to delete ALL ORDERS that contain one of three products (we'll call them Products AA, BB, and CC for now). The issue here is that there are multiple rows for each OrderID, and the only thing making each row unique is the ProductID it lists. Below is a very simplified version of what I mean:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 2019-02-23 at 2.02.03 PM.png" style="width: 193px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6638i4ABC013F47F377C9/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screen Shot 2019-02-23 at 2.02.03 PM.png" alt="Screen Shot 2019-02-23 at 2.02.03 PM.png" /&gt;&lt;/span&gt;This is as far as I've gotten so far- before loading the file into Qlik Sense, I added a column in excel called "Exclusions" where each row shows 0 or 1 depending on whether or not the ProductID for that row is AA, BB, or CC. Once the file was uploaded via the Data Load Editor, I loaded a new table that aggregated all the "Exclusion" values as grouped by OrderID. This successfully assigned each OrderID an OrderSum of 0 if it needed to be kept in the data. Beyond this, I have no clue what to do. I've tried just about every Join, Keep, Select, Mapping, or Load statement I could possibly find. Nothing has worked in any form, however simple or complicated the proposed solution. Pasted below is what HAS worked, i.e. everything up to the aggregated scores:&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;LOAD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quantity,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cost,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; marginP,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; margin2,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EmployeeID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exclusion&lt;BR /&gt;FROM [lib://Data/Sales.xls]&lt;BR /&gt;(biff, embedded labels, table is Orders$);&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;SumTable$:&lt;BR /&gt;LOAD OrderID, Sum(Exclusion) as OrderSum Resident Orders$ Group By OrderID;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548369#M744621</guid>
      <dc:creator>ellensadler</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Remove rows- Duplicate OrderID, Unique ProductID</title>
      <link>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548372#M744622</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;// test table, replace with your excel&lt;BR /&gt;t:&lt;BR /&gt;load * Inline [&lt;BR /&gt;OrderID, ProductID&lt;BR /&gt;1,AA&lt;BR /&gt;1,FF&lt;BR /&gt;1,CC&lt;BR /&gt;2,BB&lt;BR /&gt;2,FF&lt;BR /&gt;3,DD&lt;BR /&gt;3,EE&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// orders to exclude&amp;nbsp;&lt;/P&gt;&lt;P&gt;t1:&lt;BR /&gt;load OrderID as ExcludedOrderID&lt;BR /&gt;resident t&lt;BR /&gt;where match(ProductID, 'AA','BB','CC');&lt;/P&gt;&lt;P&gt;// load orders&lt;/P&gt;&lt;P&gt;f:&lt;BR /&gt;noconcatenate load *&lt;BR /&gt;resident t&lt;BR /&gt;where not exists(ExcludedOrderID, OrderID) ;&lt;/P&gt;&lt;P&gt;drop table t;&lt;BR /&gt;drop table t1;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Feb 2019 20:29:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548372#M744622</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2019-02-23T20:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Remove rows- Duplicate OrderID, Unique ProductID</title>
      <link>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548381#M744623</link>
      <description>Thanks for your prompt response! Unfortunately the actual data set that I'm working with isn't just 7 rows and 2 fields- it's 12 fields and almost 2200 rows. What will that mean for the Inline statement? (And sorry if this question seems too elementary! I tried searching the Qlik help articles for more on Inline statements but had little luck.)</description>
      <pubDate>Sat, 23 Feb 2019 23:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548381#M744623</guid>
      <dc:creator>ellensadler</dc:creator>
      <dc:date>2019-02-23T23:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Remove rows- Duplicate OrderID, Unique ProductID</title>
      <link>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548408#M744624</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/14787"&gt;@maxgro&lt;/a&gt;&amp;nbsp; used inline load just to demonstrate. Please usehttps://help.qlik.com/en-US/sense/February2019/Subsystems/Hub/Content/Sense_Hub/LoadData/use-data-load-editor.htm&amp;nbsp; to learn more on how to load data automatically&lt;/P&gt;</description>
      <pubDate>Sun, 24 Feb 2019 08:22:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548408#M744624</guid>
      <dc:creator>pradosh_thakur</dc:creator>
      <dc:date>2019-02-24T08:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Remove rows- Duplicate OrderID, Unique ProductID</title>
      <link>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548422#M744625</link>
      <description>&lt;P&gt;I have attached two files, &lt;STRONG&gt;an excel with some test data&lt;/STRONG&gt;;&amp;nbsp;&amp;nbsp;I just used few rows and 5 columns; you can adapt the code to your excel&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Data in Excel.png" style="width: 348px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6650i7132A0FE4A991071/image-size/large?v=v2&amp;amp;px=999" role="button" title="Data in Excel.png" alt="Data in Excel.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and a small Sense app&lt;/STRONG&gt; with the script&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;t:
LOAD
    OrderID,
    ProductID,
    Col3,
    Col4,
    Col5
FROM [lib://TestFolder/as excel.xlsx]
(ooxml, embedded labels, table is Foglio1);

t1:
load OrderID as ExcludedOrderID
resident t
where match(ProductID, 'AA','BB','CC');

// load orders
f:
noconcatenate load *
resident t
where not exists(ExcludedOrderID, OrderID) ;

drop table t;
drop table t1;&lt;/PRE&gt;&lt;P&gt;you can see the result in the table in Sense app&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table in Sense.png" style="width: 503px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6651i9C98D2459CD52D31/image-size/large?v=v2&amp;amp;px=999" role="button" title="Table in Sense.png" alt="Table in Sense.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Feb 2019 09:41:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Remove-rows-Duplicate-OrderID-Unique-ProductID/m-p/1548422#M744625</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2019-02-24T09:41:58Z</dc:date>
    </item>
  </channel>
</rss>

