Show distinct record in InfoSet query

Hello all.
I have a silly question about the InfoSet. I have a InfoSet joins the Sales Order OSD (ODS1) and Sales Schdule Line ODS (ODS2), using Sales Document number and Sales Document item.
If for 1 Sales Order there are 2 Schedule Lines, the query will show doubled Sales Order figures.
For example.
In ODS1
Sales Order #1, Qty = 5
Sales Order #2, Qty = 3
In ODS2
Sales Order #1, Schedule line 1, Confirmed qty = 3
Sales Order #1, Schedule line 2, Confirmed qty = 2
Sales Order #2, Schedule line 1, Confirmed qty = 1
Sales Order #2, Schedule line 2, Confirmed qty = 1
Sales Order #2, Schedule line 3, Confirmed qty = 1
Then in the query, it will show Sales Order Qty for #1 is 10, Sales Order Qty for #2 is 9.
I think this is because of the InfoSet join, when #1 is joined, totally we have 2 rows. When #2 is joined, totally we have 3 rows.
Is there any way to avoid this?
(In MultiProvider we can specify figures only came from a paritcular InfoProvider. But there's no such function in InfoSet)
Please help. Thanks a lot.

Thanks Oscar.
I tried, but it does not help.
Since the minimum (or maximum) of each single row is the same, it's meaningless on this setting.
For example.
In ODS1
Sales Order #1, Qty = 5
In ODS2
Sales Order #1, Schedule line 1, Confirmed qty = 3
Sales Order #1, Schedule line 2, Confirmed qty = 2
After joining we have have below rows:
Sales Order #1, Qty=5, Schedule line 1, confirmed qty = 3
Sales Order #1, Qty=5, Schedule line 2, confirmed qty = 2
Min or Max qty is still 5.
Is there any other way? Thanks very much.

Similar Messages

  • Select distinct from an infoset query

    Hello
    I need to select distinct / delete duplicate from an infoset query created thru SQ02.
    Please let me to know how this can be done?
    Many thanks in advance!
    regards
    Sanjyot

    Hi,
    You can verywell use infoset query if you are doing following things
    Join using Keyfields to retreive data from tables
    If not using keyfields create index for those table fields  in those fields which will improve in accessing database
    Try to use minimum of tables of small size dont try to join big tables like GLPCA and all.
    Try to load small set of data like a period or month. Dont try for a year or so.
    if your performance is good for aperiod you can go for a year.
    If you are good in function module you can try function module in which you will have the option of specifying no of records to be selected usign package size.
    Hope this helps for you.
    Thanks,
    Arun

  • How to restrict records in Infoset query

    Hi Friends,
      I have created an Infoset & a query based on this infoset. I would like to restrict certain records being displayed, based on field value, say if field A = 'Blank' I do not want to see this record on the Bex report.
    Please let me know if this is possible at all.
    Thanks,
    JB

    Hi,
    if you want to restrict a report based on a characterristic value you have to:
    1)Open the query in design mode
    2)Insert the characteristic in your report (in this example field "A")
    3)Double clikc in the characteristic
    4)You will see 2 tabshett, here you have the option to restrict in a estatic (using a fix value) or dinamic value (usign variable)
    5)For example use static value, select the desire value and then OK
    6)Save
    7)Execute.
    Regards
    Asign points if useful please

  • How to distinct records?

    hi,
    i need to distinct records in my query but i don't know how to do that.
    i use SQLX functions. this is my query:
    select xmlelement ("narqdi",
    xmlelement ("order",
    (select xmlagg (
    xmlconcat (
    xmlelement ("nom_order", nor.nom_order),
    xmlelement ("nch", nor.chnom1),
    xmlelement ("partida",
    (select xmlagg (
    xmlconcat (
    xmlelement ("npartida", nor2.npartida),
    xmlelement ("ppnom",
    (select xmlagg (xmlelement ("pnom", nor3.pnom))
    from narqd_order nor3
    where nor3.nom_order = nor2.nom_order
    and nor3.npartida = nor2.npartida
    from narqd_order nor2
    where nor2.nom_order = nor.nom_order
    from narqd_order nor
    where nor.NOM_ORDER = '5970'
    from dual
    i have 18 records in table for record nom_order = '5970' and i receive 18 tags <partida> and 18 tags for each ppnom :(
    please help me.
    i tried to put distinct in every select but this is no reason.
    i tried to put agregate function in each select statement but in select for <pnom> it does not work...
    best regards
    Message was edited by:
    Fitibaldi
    Message was edited by:
    Fitibaldi

    Arti,
    Here's another solution (that will still use locking, and can help avoid the "lost update" problem):
    http://stegemanoracle.blogspot.com/2006/03/using-updatable-views-with-adf.html
    John

  • Select distinct records in query

    If I want to read a table in an infoset, how can I just select distinct entries from the table?
    Is it done at the infoset level or the query level?

    I've actually created the infoset for table VBFA and created a query.
    But I can't limit the output such that for each DO, show only distinct subsequent Invoice.
    eg. DO 123 has 3 items, and this DO 123 has only 1 Invoice 456, then in the output, there will be
    DO    |     Invoice
    123   |     456
    123   |     456
    123   |     456
    It's repeated 3 times because there are 3 items in VBFA for this DO. How can I create the infoset/query so that the output will be 1 entry only, ie
    DO    |     Invoice
    123   |     456
    Thanks

  • Infoset Query - Filter Records

    Dear Experts,
    Please help me in defining in-built filter (by field values) in an Infoset query.
    Regards
    Jogeswara Rao

    Thanks Venu,
    This I am following already.
    But this is not totally fool-proof. If someone uses his own selection screen variant then the setup disturbs.
    If you are referring to ALV layout variant, that does not solve my problem. Because the output just filters the records, but the records are selected, this selection gives rise to a problem here (in some calculations)
    In-fact the filter word in my query, is meant towards Not selecting OR Deleting records of certain field values
    So I want this to be in-built either in Infoset itself or query design.
    (of course, I prefer a way free of code)
    Regards
    Jogeswara Rao
    Any inputs Expers?
    Kind Regards
    Jogeswara Rao
    Edited by: K Jogeswara Rao on May 22, 2011 9:22 AM

  • How to show multipe records on a single record

    Hi all,
    I have a query which can contain 1 or Many records for each S.WAS_NO or APPL_NO even. A new record is created when the APPL_STATUS changes and a timestamp is created in APPL_STATUS_CHANGE_DATE.
    select distinct
           S.APPL_ID,
           S.WAS_NO,
           S.AS_STATUS,
           S.STATUS_CHANGE_DATE,
           dense_rank() over (partition by S.WAS_NO order by S.STATUS_CHANGE_DATE) rank
      from table_a S, table b S2
    where S.APPL_ID = S2.APPL_ID
    order by S.WAS_NO, rank asc;
    Current Results:
    APPL_ID---WAS_NO---------------AS_STATUS----STATUS_CHANGE_DATE-----RANK
    6628-------E4G0YL9B08V0V6---ASSIGNED-------25/10/2011----------------------1
    6628-------E4G0YL9B08V0V6---USED--------------30/12/2011----------------------2
    Desired Results:
    APPL_ID--WAS_NO------------------AS_STATUS1----STATUS_CHANGE_DATE1----AS_STATUS2----STATUS_CHANGE_DATE2
    6628-------E4G0YL9B08V0V6----ASSIGNED---------25/10/2011------------------------USED--------------30/12/2011The rank is based on the WAS_Number and ordered by the STATUS_CHANGE_DATE so i know which order they should go in.
    I want to show 1 record per WAS_NO and show each status change with its date. There can only be a maximum of three status changes.
    I have not been able to workout how to get Multiple records onto a singe record and in different columns.
    Many thanks

    This should do what you want:
    WITH t AS
    (SELECT 6628 appl_id, 'E4G0YL9B08V0V6' was_no, 'ASSIGNED' as_status, TO_DATE('25/10/2011', 'DD/MM/YYYY') status_change_date FROM dual UNION ALL
    SELECT 6628 appl_id, 'E4G0YL9B08V0V6' was_no, 'USED' as_status, TO_DATE('30/12/2011', 'DD/MM/YYYY') status_change_date FROM dual UNION ALL
    SELECT 6628 appl_id, 'E4G0YL9B08V0V6' was_no, 'COMPLETE' as_status, TO_DATE('15/01/2012', 'DD/MM/YYYY') status_change_date FROM dual UNION ALL
    SELECT 6629 appl_id, 'A5AAFG1C07L0P2' was_no, 'ASSIGNED' as_status, TO_DATE('19/01/2012', 'DD/MM/YYYY') status_change_date FROM dual)
    SELECT   appl_id,
             was_no,
             MAX(CASE rank
             WHEN 1 THEN as_status
             ELSE NULL
             END) as_status1,
             MAX(CASE rank
             WHEN 1 THEN status_change_date
             ELSE NULL
             END) status_change_date1,
             MAX(CASE rank
             WHEN 2 THEN as_status
             ELSE NULL
             END) as_status2,
             MAX(CASE rank
             WHEN 2 THEN status_change_date
             ELSE NULL
             END) status_change_date2,
             MAX(CASE rank
             WHEN 3 THEN as_status
             ELSE NULL
             END) as_status3,
             MAX(CASE rank
             WHEN 3 THEN status_change_date
             ELSE NULL
             END) status_change_date3
    FROM    (SELECT appl_id,
                    was_no,
                    as_status,
                    status_change_date,
                    DENSE_RANK() OVER (PARTITION BY was_no ORDER BY status_change_date) rank
             FROM   t)
    GROUP BY appl_id,
             was_no

  • BW Datasource on an Infoset Query based on 2 DSO Active tables

    Hello,
    We have created a Datasource in the BW system over an Infoset query (through SQ02) built on 2 DSO tables.
    In RSA3, this datasource is working fine - it shows us some data (close to 1000 records).
    The issue is when i try and run a infopackage for the datasource.
    The request times out and no records are fetched.
    I have added all the users to the Infoset user group - so, no issue with the authorization.
    IDoc Statuses changes from 53 --> 62 --> 64 --> 50.
    The extraction process does not complete - does not get the no. of records sent.
    Can anybody point to a probable cause here?
    Thank you.

    IDoc logs do not say much.
    Status Record 53: IDoc was successfully transferred
    Status Record 62: IDoc passed to application; Direct call started
    Status Record 64: IDoc ready to be transferred to application; No filter, no conversion
    Status Record 50: IDoc added
    Then, it does not go any further.
    We're using the Datasource on the Infoset query because we could not use the traditional BW infoset.
    Datsource is used to feed a DSO as we directly could not use anything else (we're trying with an expert routine also).
    The issue is that the base DSO tables are huge and querying on them (using SELECT) is taking a very long time.
    So, we thought of using an Infoset to create a view and then populatet he data.
    In an traditional infoset, we could not specify a condition with a range. So, the infoset query through SQ02.
    I have not tried using an APD, but that might be a good option.
    Only thing, we'll have to use a Direct DSO - which i am not sure will satisfy our requirement.
    Thank you.

  • Infoset Query based on 0023 IT

    Hi,
    I have created one infoset query for infotype 0023. When I am executing this report for all the employees I can see the records. But if I select just one employee only blank fields are coming.
    Samriddhi

    Hi,
    That employee has four records on 0023 infotype.
    And I have checked with both Reporting periods All and Past(until today).
    But still one record is coming that too blank although employee has four records.
    1st record (01.06.2000 - 21.12.2002)
    2nd record (01.12.1996 - 01.06.2000)
    3rd record (01.04.1991 - 01.08.1996)
    4th record (01.061989 - 01.03.1991)
    Then I created one more record from the date 01.09.2008(start date in the present company) to
    31.12.9999.
    When I am executing the Adhoc Query I am getting only this last record. In selection I have choosen personnel number of that employee.
    But if in the selection field I didn't choose any personnel number it will show all the records of all employee.
    Samriddhi

  • Value Set whose Data come from customize table with distinct record

    Dear All,
    I am new in Oracle EBS, currently i am creating value set whose data come from customize table which have 40 duplicate record in which distinct column return 27 record .
    Table XX_ROUND_SET
    Columns (Transactions_id,set_record)
    Total Record (40)
    Distinct Record (Set_Record --> 27)
    I just want to show only 27 record in it.
    Thanks
    Rehan

    Hi Rehan,
    PL.IGNORE MY EARLIER UPDATE AND TREAT THIS UPDATE AS YOUR SOLUTION.
    Method 1
    Create the VIEW based on DISTINCT values; use the VIEW for creates the VALUESET.
    Method 2
    Paste the QUERY in TABLE field with alias name, and give the column name (with alias name).
    (in your case )
    TABLE NAME : ( select distinct transactions_id, set_record from XX_ROUND_SET ) Y
    VALUE : Y.transactions_id
    HTH
    Sanjay

  • How to create infoset query

    Hi,experts
    Can anybody give me documents on infoset query and step by step showing how to create infosetquery. I will really greatful to you all.
    Thanks
    Preeti

    Hi Preeti,
    1. You can query the data using 'Listcube' transaction.
    2. Instead of builing on tables, it sits on ODS (no need to worry about underlying tables).
    3. Visible on the Bex 'info area' as like other infoproviders.
    4. It generates additional key figure called 'Number of records' in the Bex. This will be useful for query.
    5. No additional ABAP can be used. But in RSQ02, you can use piece of ABAP.
    6. Queries created on data provider infoset can work like other queries including transport functionality.
    Hope helps.
    For more info check Re: Query on Infoset
    Bye
    Dinesh

  • Infoset Query Performance

    MSSQL Server 2000
    BW 3.1C
    R/3 6.20
    BW 3.0B Frontend
    I created an infoset with 2 huge tables (one holding approx. 10 mil records w/ 20+ attribs, and the other holding approx. 3 mil records w/ 30+ attribs).  I didnt include ALL attributes in the infoset, maybe just 15 total on both of the tables.  They do have a common field to join, one is the key field of one table, and the other is the attribute of the other.  They are both info objects with master data.
    The join is an inner join in which the tables have a 1 to many relationship.
    I created indeces individually for each table.  But when I run a query that SHOULD use the indeces, it still takes a very long time to run (approx. 5-10 mins, per navigation).  When viewing the Run Schedule for this query, it does show that it scans for clustered indeces for the (many table) and regular indeces for the (one table).  But
    Any suggestions on how I could have this query run faster?

    To whom are interested in the Infoset topic.
    As of Release 2.0B, the InfoSet Query is available in BW as a tool for special requests from the area of the master data reporting. A new InfoProvider, also known as an InfoSet, was introduced into BW for Release 3.0A.
    The OSS Note 486789 provides recommendations about using InfoSets in different BW releases and explains in more details the difference among SAP Query, InfoSet Query, InfoSet (Basis), InfoSet (BW).
    Hope this can be useful for all of you, guys.
    Bye,
    Roberto

  • HELP Please! How do I Filter to only show Unque Records based on a Field?

    Post Author: MCourtney
    CA Forum: WebIntelligence Reporting
    Hello,I am using BOXI R2.  I know there has got to be a simple way to do this but I cannot figure this out.  Problem:I have a Query that returns some Purchase Orders...The way the data is, I have purchase orders that have the same value/ID (duplicates) but I only want to show the unique or distinct record...(i.e. the first record that comes back from the query) - So, for example if I had two PO Numbers in the result set, how would I only have the result show the Distinct value, or the first record and not the second.  If I could get access to the SQL, it would be easy as I would simply apply the DISTINCT function to the statement but I can't, so how would I do this without access to SQL?!?! Please help! Thanks everyone, Mark

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    Mark,
    Not knowing the full details of your report requirements and its data, here is one suggestion.  If you can avoid using any type of metric or measures from the initial build of your query (you know, where you drag items from the universe into your "Results Objects" pane), and then when you run the report BO will place a "distinct" on the select clause of the resultant SQL.  If you do need to do some summarizing (like count this or count that), you may be able to apply a local variable to your report to achieve versus pulling it in from your initial query.  Again, not knowing the full details of your report, so this technique of avoiding the use of any metrics or measure may not be an option for you, and thus, I too would be stumped.

  • Distinct Records Selection in Crystal 11

    Need to select Distinct Records only, but the drop down under 'Database' shows the 'Select Distinct Records' option grayed out.  Why does Crystal do that, and how may I eliminate duplicate records?  Thanks!

    Hi Brian,
    This issue normally comes when there are multiple datasources being used. For example if you are using two databases, like Oracle and MS Access to fetch data, the "Select Dictinct Records" will be greyed out.
    In this case, you might want to write a query in the Add Command option which select distinct records.
    If you are using only one database, then check if you are able to select "Select Dinstinct Records" in the Database menu.
    Please let us know if this helps.
    Regards,
    Abhishek.

  • Get Distinct records with a condition

    I have a table with multiple records per Person and an active status column. I would like to fetch distinct records by PersonID and PersonName but also return active status with a condition that if person is active on at least one he is considered active.
    Here is my table.
    DECLARE @Person TABLE (PersonID INT, PersonName VARCHAR(50), DeptName VARCHAR(50), Active bit)
    INSERT INTO @Person (PersonID, PersonName, DeptName, Active) VALUES (111, 'John', 'Finance', 0), (111, 'John', 'HR', 1),(222, 'Jack', 'Payroll', 0),(333, 'Mark', 'Facilities', 1),(444, 'Bill', 'IT', 0),(444, 'Bill', 'HR', 1),(444, 'Bill', 'Finance', 1)
    My resultset after the query should be as follows.
    (111, 'John', 1),(222,'Jack',0),(333,'Mark',1),(444,'Bill',1)
    Thanks for the help.

    >> I have a table with multiple records [sic] per Person and an active status column. <<
    Rows are not records. Tables have to have a key by definition and since they model a set, the names are plural or collective. These are fundamentals that were covered in the first few chapters of any book on RDBMS. You do not know ISO-11179 naming rules. 
    You still use assembly language bit flags in SQL! A status is a state of being so it requires a temporal component. Do you really know people with FIFTY character name? Even in Poland and India, that is not likely. But when you allow garbage data, you will
    get it. 
    Identifiers are CHAR(n), not numeric; what math do you do with them? Again, this is a fundamental of data modeling. 
    You are simply reenforcing your bad habits and not taking the time to learn how to do RDBMS correctly. 
    CREATE TABLE Personnel --- collective name!
    (person_id CHAR(3) NOT NULL,
     person_name VARCHAR(10) NOT NULL, 
     dept_name VARCHAR(10)NOT NULL, 
     hire_date DATE NOT NULL,
     termination_date DATE,
     CHECK (hire_date < termination_date),
     PRIMARY KEY (person_id, hire_date));  -- null means current.
    See how a valid design makes finding a status possible? And it shows us just what a mess you have! Bill is working in TWO departments! See how the key prevents this error? We should add more constraints, but I do not think you are ready for that yet. 
    SELECT person_id, person_name, dept_name AS current_dept_name
      FROM Personnel 
     WHERE termination_date IS NULL;
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

Maybe you are looking for