<?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>Question Re: Record duplication issue in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201930#M2275971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is happening because the item number appears multiple times in one or more of the "left tables" in the join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to fix it depends on what you are trying to accomplish.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are trying to match something like Order Details to Shipment Details against those orders, you'll need an order and line number in your Shipment Details file that reference the same fields in the Order Detail file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are just looking for total ordered vs total shipped, you'll need to aggregate the ordered and shipped quantities by item BEFORE doing the join.  In SQL it would look something like this (MS SQL):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select isnull(a.item_no, b.item_no) as Item_no, 
   isnull(a.ordered_qty,0) as ordered_qty, 
   isnull(b.shipped_qty, 0) as shipped_qty
from (
    select item_no, sum(ordered_qty) as ordered_qty
    from Order_Details
    where date between {?start date} and {?end date}
    group by item_no
) a
full outer join (
    select item_no, sum(shipped_qty) as shipped_qty
    from Shipment_Details
    where date between {?start date} and {?end date}
    group by item_no
) b
on a.item_no = b.item_no
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Oct 2009 17:16:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-01T17:16:46Z</dc:date>
    <item>
      <title>Record duplication issue</title>
      <link>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaq-p/6201929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am currently having an issue linking two tables in a report.  When I generate the report, the records in the detail section become duplicated.  To further explain, in one table I am looking for item numbers, transaction date and transaction quantity.  &lt;/P&gt;&lt;P&gt;In the next, I am looking for item numbers, transaction dates, and shipment quantities.&lt;/P&gt;&lt;P&gt;In the last I am retrieving item numbers and descriptions.  &lt;/P&gt;&lt;P&gt;The only fields that seem to be consistent between tables are the item numbers, so I am joining on that basis.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;However, what ends up happening is this:&lt;/P&gt;&lt;P&gt;Item #   Date       Trans Qty      Date        Ship Qty&lt;/P&gt;&lt;P&gt;1001 (Grouping)&lt;/P&gt;&lt;P&gt;              5/12/09     49000       5/20/09     20000&lt;/P&gt;&lt;P&gt;              5/12/09     49000       5/28/09     12000&lt;/P&gt;&lt;P&gt;              6/1/09       30000       5/20/09     20000&lt;/P&gt;&lt;P&gt;              6/1/09       30000       5/28/09     12000&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;2001 (Group)&lt;/P&gt;&lt;P&gt;              5/12/09     20000       5/5/09       20000&lt;/P&gt;&lt;P&gt;              5/12/09     20000       5/19/09     12000&lt;/P&gt;&lt;P&gt;              5/12/09     20000       6/5/09       15000&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;If you know why this is happening, or better yet, a way to fix it, I would greatly appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 14:58:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaq-p/6201929</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-01T14:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Record duplication issue</title>
      <link>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201930#M2275971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is happening because the item number appears multiple times in one or more of the "left tables" in the join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to fix it depends on what you are trying to accomplish.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are trying to match something like Order Details to Shipment Details against those orders, you'll need an order and line number in your Shipment Details file that reference the same fields in the Order Detail file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are just looking for total ordered vs total shipped, you'll need to aggregate the ordered and shipped quantities by item BEFORE doing the join.  In SQL it would look something like this (MS SQL):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select isnull(a.item_no, b.item_no) as Item_no, 
   isnull(a.ordered_qty,0) as ordered_qty, 
   isnull(b.shipped_qty, 0) as shipped_qty
from (
    select item_no, sum(ordered_qty) as ordered_qty
    from Order_Details
    where date between {?start date} and {?end date}
    group by item_no
) a
full outer join (
    select item_no, sum(shipped_qty) as shipped_qty
    from Shipment_Details
    where date between {?start date} and {?end date}
    group by item_no
) b
on a.item_no = b.item_no
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 17:16:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201930#M2275971</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-01T17:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Record duplication issue</title>
      <link>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201931#M2275972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not to sound like I have no idea what I am doing, but where do I enter this formula.  Do I enter it in Report-&amp;gt;Selection Formulas?  Please let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 18:18:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201931#M2275972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-01T18:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Record duplication issue</title>
      <link>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201932#M2275973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is an SQL Command data source, so it would be entered in the Database Expert, after removing your existing table selections.  Also, what I posted was not a sample SQL statement, so it will have to be revised, which will require knowledge of your database and SQL...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 18:29:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201932#M2275973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-01T18:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Record duplication issue</title>
      <link>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201933#M2275974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have CRXI, if you click on database, show query,(you should copy the query)  it should show the query your report is based on.&lt;/P&gt;&lt;P&gt;If you click on database, set database location, you can create a "New Connection"  say you select ODBC&lt;/P&gt;&lt;P&gt;you can then pick your database, select add command, select your original database (top window) select update&lt;/P&gt;&lt;P&gt;, you will be able to put a command in (Paste your query)...  Anyway, quick and dirty way to add a command to a report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on what you want, you may need to add some grouping levels, and just supress the details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 19:13:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201933#M2275974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-01T19:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Record duplication issue</title>
      <link>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201934#M2275975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have CRXI, if you click on database, show query,(you should copy the query)  it should show the query your report is based on.&lt;/P&gt;&lt;P&gt;If you click on database, set database location, you can create a "New Connection"  say you select ODBC&lt;/P&gt;&lt;P&gt;you can then pick your database, select add command, select your original database (top window) select update&lt;/P&gt;&lt;P&gt;, you will be able to put a command in (Paste your query)...  Anyway, quick and dirty way to add a command to a report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on what you want, you may need to add some grouping levels, and just supress the details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 19:13:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201934#M2275975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-01T19:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Record duplication issue</title>
      <link>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201935#M2275976</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;Is it necessary to use tables?u may use a command insted of query.&lt;/P&gt;&lt;P&gt;In query u may use joins and get the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Misra P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Oct 2009 08:59:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/record-duplication-issue/qaa-p/6201935#M2275976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-06T08:59:08Z</dc:date>
    </item>
  </channel>
</rss>

