Outer join between logical tables

Hello,
This question is likely to be asked many times, but I failed to find the proper thread in the forum.
Assume there are 2 logical tables "Fact" and "Dim".
"Fact" has 1 LTS which consists of physical tables F, FX1, FX2 which are inner joined.
"Dim" has 1 LTS which consists of physical tables D, DX1, DX2 which are inner joined.
F and D tables are also joined together on physical layer.
I define left outer join between "Fact" and "Dim" on logical layer.
I create a request in Answers, querying columns from "Fact" and "Dim" which map to physical tables F and D only.
I expect OBIEE to build SQL query which uses F and D tables only, outer joined.
Instead of that all the physical tables used for logical tables "Fact" and "Dim" are joined together in a form like:
SELECT F.col, D.col
FROM (F inner join FX1 inner join FX2) left outer join (D inner join DX1 inner join DX2)
Is there any way to avoid this behavior or build data model in different way?
Thank you!

Hi Alex,
In BI Applications you never have a null in a facts foreign key to the dimension. Instead there is always a zero row wi record inserted with 'Unspecified' in all the columns. When the fact table is populated in the ETL, if the fact record doesn't have a corresponding dimension record the WID is poulated with zero.
This removes the problems with outer joins and helps considerably with performance.
This could be one practice you take from BI Apps and put into your own ETL's and data model.
Regards
Robin

Similar Messages

  • [nQSError: 14044] Missing join between logical tables

    Hi All,
    I have three physical tables:
    A- Dimension (Contact) B- Helper (Con-Prod) C- Dimension (Product). 'A' joins to facts.
    Relationships are:
    A:B=1:M and B:C=N:1
    Currently a column of B table has been implemented as MLOV. As a result now I have one additional MLOV physical table 'D' that joins to 'B' (Since its B.MLOV_WID=D.MLOV_WID , its not a foreign key join).
    The Logical Layer has three Logical tables: A, B and C as in the Physical Layer. B table has got one new LTS for 'D'.
    Now the Problem is when I take a column that is sourced from D and another from C, it generates an error in Answers: Missing join between logical tables B and C. I have verified that the Logical and Physical joins exist.
    I think this is something with the Logical level setup. So here's some more information on hierarchy setup. I have one Hierarchy (Contact) for all those Logical tables. I have setup Level for the MLOV column. I don't have level setup for most of the non-MLOV columns.
    Can you please share your thoughts? I would like to avoid implicit join method.

    Hi,
    It seems like you are pulling a report from 2 tables with NO physical join.
    Please check the physical layer diagram and join the 2 tables.
    Thanks,
    Vineeth

  • Left outer join using multiple table

    Hi,
    I am trying to use left outer join with multiple tables , the join condition will be based on  PERNR and BEGDA & ENDA for each infotype in selection screen.
      select pa00~pernr pa00~begda pa00~endda pa00~massn pa00~massg pa00~stat2 pa00~aedtm pa00~uname
        pa01~begda pa01~endda pa01~bukrs pa01~persg pa01~persk pa01~mstbr pa01~ename pa01~aedtm pa01~uname
        pa02~begda pa02~endda pa02~nachn pa02~vorna pa02~midnm pa02~aedtm pa02~uname
        pa016~begda pa016~endda pa016~cttyp pa016~aedtm pa016~uname
        into CORRESPONDING FIELDS OF TABLE i_pall
        from  ( PA0000 as pa00 left OUTER JOIN pa0001 as pa01 on pa00~pernr = pa01~pernr )
        left OUTER JOIN pa0002 as pa02 on pa00~pernr eq pa02~pernr )
        left OUTER JOIN  pa0016 as pa016 on pa00~pernr eq pa016~pernr )
        where pa00~pernr in S_pernr
        AND pa00~begda in s_bg0000
        and pa00~endda in s_nd0000.
    but this fails  to fetch the value of begda enda from each pa0000,pa0001,pa0002,pa0016.
    Please help!
    Monirul

    Why don't you use the standard logical database PNPCE and then Provide statement?

  • Case statement resulting into Left outer join with other tables

    Hi All ,
    I am facing a stuation where a Case statement on one of the logical columns in Answers is resulting into a left outer join with a table in the query.
    If we remove the case stmt, the table is not being acessed.
    The case stmt is a simple one and no other logical column is being accessed in the case stmt.
    Please advice .
    Thanks.

    Hi Sai,
    No ..we dont have any left outer join ...its just that I am selecting measure from F1 which has a confimred dimension D1 with F2.Now when I dont have case stmt on measure from F1(Case stmt is something like : CASE WHEN "- P table"."P Column" = 'Y' THEN 'Right' ELSE 'Wrong' END), then it doesnt query F2.
    However as soon as I introduce the case stmt ,the query creates a left outer join with F2.
    Thanks.

  • How can we make an outer join (+) between 2 Queries

    in the data model, i have 2 queries
    i.e
    Q_master and Q_detail
    i want to make a data link between
    these two queries and
    also make an outer join between these
    two queries(i.e. to display all the detail
    records, whether they have details or not)
    please reply is it possible ?
    if yes then how?
    plz write.
    [email protected]
    null

    Hello,
    Left outer join behavior is what you get by default with a link between two queries in Reports.
    If you want a full outer join behavior, you'll need to create a third query that selects the detail records that have no corresponding master, and also create an extra layout region to display them in as a default group left or group above won't pick up these extra records.
    If you want right outer join behavior, you'll need to put in a summary in the master query that counts the rows in the detail, and then put in a format trigger in the master repeating frame that suppresses printing when there are no detail records. And you'll also need the third query and layout section as in the full outer join case.
    Regards,
    The Oracle Reports Team --skw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Maximum number of tables that can be outer joined with one table in a query

    Hi All,
    Iam new to sql, so can you please let me know What is the maximum number of tables that can be outer joined with one table in a query?
    Thanks,
    Srini

    srinu2 wrote:
    Iam new to sql, so can you please let me know What is the maximum number of tables that can be outer joined with one table in a query?
    There is no limit to the number of tables you can outer join as long as you join them correctly.
    SQL> with a as
      2      (
      3      select 1 id, 2 b_key, 3 c_key from dual union all
      4      select 2 id, 1 b_key, 4 c_key from dual union all
      5      select 3 id, 3 b_key, 1 c_key from dual union all
      6      select 4 id, 4 b_key, 2 c_key from dual
      7      ),
      8      b as
      9      (
    10      select 1 id, 1 c_key2 from dual union all
    11      select 2 id, 5 c_key2 from dual union all
    12      select 3 id, 3 c_key2 from dual union all
    13      select 4 id, 2 c_key2 from dual
    14      ),
    15      c as
    16      (
    17      select 1 key1, 1 key2, '1-1' dta from dual union all
    18      select 1 key1, 2 key2, '1-2' dta from dual union all
    19      select 1 key1, 3 key2, '1-3' dta from dual union all
    20      select 1 key1, 4 key2, '1-4' dta from dual union all
    21      select 2 key1, 1 key2, '2-1' dta from dual union all
    22      select 2 key1, 2 key2, '2-2' dta from dual union all
    23      select 2 key1, 3 key2, '2-3' dta from dual union all
    24      select 2 key1, 4 key2, '2-4' dta from dual union all
    25      select 3 key1, 1 key2, '3-1' dta from dual union all
    26      select 3 key1, 2 key2, '3-2' dta from dual union all
    27      select 3 key1, 3 key2, '3-3' dta from dual union all
    28      select 3 key1, 4 key2, '3-4' dta from dual union all
    29      select 4 key1, 1 key2, '4-1' dta from dual union all
    30      select 4 key1, 2 key2, '4-2' dta from dual union all
    31      select 4 key1, 3 key2, '4-3' dta from dual union all
    32      select 4 key1, 4 key2, '4-4' dta from dual
    33      )
    34  select d.a_id, d.b_id, c.key1 as c_key1, c.key2 as c_key3, c.dta
    35  from
    36      c,
    37      (
    38      select
    39          a.id as a_id, b.id as b_id, a.c_key, b.c_key2
    40      from a, b
    41      where a.b_key = b.id
    42      ) d
    43  where d.c_key = c.key1 (+)
    44  and   d.c_key2 = c.key2 (+);
          A_ID       B_ID     C_KEY1     C_KEY3 DTA
             3          3          1          3 1-3
             4          4          2          2 2-2
             2          1          4          1 4-1
             1          2
    SQL>

  • How to use outer join on 3 tables

    how to use outer join on 3 tables
    say tables are mkpf,lips and vbrp
    mkpf-xblnr = lips-vbeln
    lips-vbeln  = vbrp-vgbel

    refer following querry
        select a~bukrs
               a~anln1
               a~ord42
               a~ord43
               b~afabe
               b~ndabj
               b~kaafa
               b~aafag
               c~kostl
               d~afasl
               d~ndjar
               d~ndper
        into corresponding fields of table gt_master
        from ( ( anla as a inner join anlc as b
        on abukrs = bbukrs
        and aanln1 = banln1
        and aanln2 = banln2 )
        inner join anlz as c
        on  abukrs = cbukrs
        and aanln1 = canln1
        and aanln2 = canln2 )
        inner join anlb as d
        on  abukrs = dbukrs
        and aanln1 = danln1
        and aanln2 = danln2
        where a~bukrs in s_comp.

  • Oracle outer join on  multiple tables throws error

    Hi ,
    We are using ansi joins with outer joins on multiple tables in oracle 9i.
    Now these queries have to be used in Oracle8i.
    Since Oracle8i does not support ansi sql we are replacing the ansi sql queries with the oracle joins.
    On trying the same we found that the following query
    select *from tab1 a, tab2 b, tab3 c where a.c1 = b.col1(+) and c.c2 = b.col2 (+)
    throws the error
    ORA-01417: a table may be outer joined to at most one other table.
    Is there a way to simulate this query without using the outer joins on multiple tables?
    thanks

    Try writing the query in this form:
    select * from
    (select t1.col1, t1.col2
    from schema.table1 t1, schema.table2 t2
    where t1.col1 = t2.col1(+)) t4,
    schema.table3 t3 where t4.col2 = t3.col2(+)
    In the subquery, you will have to list all the columns you want to see, and you will need to provide unique aliases for any columns with duplicate names. I tested this on 9i, and don't have an 8i system to work with, so I hope this helps.

  • How to provide joins between oracle tables and sql server tables

    Hi,
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server.
    how to provide joins between oracle tables and sql server tables ? Any help on this
    Regards,
    Malli

    user10675696 wrote:
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server. Bad idea most times. Heterogeneous joins do not exactly scale and performance can be severely degraded by network speed and b/w availability. And there is nothing you can do in the application and database layers to address performance issue at the network level in this case - your code's performance is simply at the mercy of network performance. With a single glaring fact - network performance is continually degrading. All the time. Always. Until it is upgraded. When the performance degradation starts all over again.
    If the tables are not small (few 1000 rows each) and row volumes static, I would not consider doing a heterogeneous join. Instead I would rather go for a materialised view on the Oracle side, use a proper table and index structure, and do a local database join.

  • Sq02: define join between 2 tables as per your choice

    Hi Team,
    I am trying to create a join between 2 tables ekko & Lfa1. The sq02 tcode by default is joining it as
    ekko-lblif = lfa1-lifnr in ecc 6.0
    While in 4.7 i found that the same joint exists as
    ekko-lifnr = lfa1-lifnr.
    I want to create the joint as ekko-lifnr = lfa1-lifnr.
    Can i do it ?
    Please advice.

    yes you can.
    right click on the default link and delete it.. then start dragging from EKKO-LIFNR field to LFA-LIFNR. it will work.

  • Subject: How to do join between two tables using something like SE16

    SE16, SE11 provide form based interface query information from a single table. Is there a way to do join between two tables without creating an infoset erc? I am looking for something similar to sql join but in SAP BI 7.0
    Thanks.

    Hi
    Pls look into below links. Hope this helps you.
    1. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45bf455611d189710000e8322d00/content.htm
    2. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45a5455611d189710000e8322d00/content.htm
    Regards
    Sirigiri

  • Outer Join for 2 Tables?

    Hi,
    i have 3 Tables, one is the "main" table.
    Table1
    Col1
    Col2
    Col3
    Table2
    Col2
    Col4
    Col5
    Table3
    Col4
    Col6
    Now i want all hits from Table 1, all outer join hits from table 2 and the regarding rows from table 3.
    The join from Table1 to Table2 is no problem, but how to add table3?
    SELECT *
        FROM table1 AS t1
              LEFT OUTER JOIN table2 AS t2
                    ON t2col2 = t1col2
       INTO CORRESPONDING FIELDS OF TABLE      result
        WHERE t1~col1 IN so_col1.

    Hi,
    a right table in an outer join cannot become a part of an inner join or an outer join. So you will have to use some other technique.
    meaing table1 connects to table2 with an outer join resulting in all rows table1 and cooresponding if existing from table2, now table2 is the right table it cannot make a join with table3. inner or outer.
    regards,
    Khusro Habib

  • Best Practice - Outer Join between Fact and Dim table

    Hi Gurus,
    Need some advice on the below scenario
    I have an OOTB subject area and we have around 50-60 reports based on it. The related subject area Fact and Dim1 table are having inner join.
    Now I have a scenario for one report where outer join has to be implemented between Fact and Dim1. Here I am against changing the OOTB subject area join as the outer join will impact the performance of other 50-60 reports.
    Can anyone provide any inputs on what is the best way to handle this scenario?
    Thanks

    Ok. I tried this:
    Driving table : Fact, Left outer join -- didnt work.
    Driving table: Dimension D left outer join -- didnt work either
    In either the case, I see physical query as D left outer Join on Fact F. and omitting the rows.
    And then I tried this -
    Driving table: Fact, RIght outer join.
    Now, this is giving me error:
    Sybase][ODBC Driver]Internal Error. [nQSError: 16001] ODBC error state: 00000 code: 30128 message: [Sybase][ODBC Driver]Data overflow. Increase specified column size or buffer size. [nQSError: 16011] ODBC error occurred while executing SQLExtendedFetch to retrieve the results of a SQL statement. (HY000)
    I checked all columns, everything matched with database table type and size.
    I am pulling Fact.account number, Dimension.account name, Fact.Measures. I am seeing this error each time I pull Fact.Account number.

  • Outer join with nested tables

    I am dealing with a nested table (I simplified the case
    for purpose of posting):
    CREATE TABLE boris_main_tab (
    IND_SSN          VARCHAR2(9) PRIMARY KEY,
    children          B_CHILDREN_TBL,
    ) nested table children stored as....
    where B_CHILDREN_TBL is defined like this:
    create or replace type b_children_type as object (
         child_ssn               VARCHAR2(9),
         child_first_name          VARCHAR2(20),
         child_last_name          VARCHAR2(20),
         child_dob               date
    create or replace type b_children_tbl as table of b_children_type;
    if I want to display person's ssn along with his/her children information I do like this:
    SELECT m.ind_ssn, c.child_ssn, c.child_first_name
    FROM boris_main_tab m,
    TABLE(m.children) c
    This is a statement I can find everywhere. But there is a caveat here, they
    forgot to mention. This is really an inner join, so I don't get childless
    people. Can you, guys, help me with the outer join syntax?
    I mean, of course, I found the obvious solution to make this inner join
    into a view and then join it with the boris_main_tab again this time using the
    regular outer join syntax. But it seems to me there has to be something simplier than that.
    But I can't find it. It really hurting me, since I have a few nested table
    columsn and people want to see the records where I need to mention a few of
    them, sort of like
    from boris_main_tab m, TABLE(m.children) c, TABLE(m.spouses) s
    where c.child_last_name <> m.spouse.last_name
    in cases like this the fact that EACH of these joins is inner join really
    hurts the logic.
    Respectfully,
    Boris

    Hi Borris,
    Found the following in the Oracle Documentation under: Oracle8i Application Developer's Guide - Object-Relational Features Release 2 (8.1.6)
    2 Managing Oracle Objects / Using Collections / Collection Unnesting
    URL: http://www.znow.com/sales/oracle/appdev.816/a76976/adobjmng.htm#1002885
    Oracle8i also supports the following syntax to produce outer-join results:
    SELECT d.*, e.* FROM depts d, TABLE(d.emps)(+) e;
    The (+) indicates that the dependent join between DEPTS and D.EMPS should be NULL-augmented. That is, there > will be rows of DEPTS in the output for which D.EMPS is NULL or empty, with NULL values for columns
    corresponding to D.EMPS.

  • Abap query, join between same tables

    Hi,
    I have an Abap Query (SQ01), I need to create a join between the same table (ESLL-ESLL) to obtain the services from a PO. The join is with the packno from ESLL to subpackno from ESLL (the same table). But I don't know how I can do that with Abap Query. Because the Infoset doesn't allow inserting the table two times.
    Somebody can help me.
    Thanks.
    Victoria

    Hi:
    I was able to create a query to retrieve the service lines entries using tables ESSR (Header) (service entry sheet number as input parameter), linked to package number to view ML_ESLL and then from the view the sup-package number linked to ESLL. That way I was able to retrieve all the service lines information from table ESLL only using SQ02 and SQ01, no ABAP.
    I Hope this help.
    Juan
    PS: I know the post is old but may be there are people out there with no ABAP access who needs to create reports for Service Entry Sheets lines. All the join conditions are.
    Table             Table
    ESSR            EKKO
    ESSR            ML_ESLL
    ML_ESLL      ESLL
    ESLL             ESLH
    Edited by: Juan Marino on Jan 23, 2012 10:53 PM

Maybe you are looking for

  • Video out from new iPod to TV (not photos)

    OK, let's get an answer to this once and for all. Can you play your own video (not purchased music videos or TV shows or iPhotos) on a TV/Monitor using the new iPod? This article http://docs.info.apple.com/article.html?artnum=300224 seems to say no.

  • OO4 character Display Problem

    Hi All, I am using Oracle OLE objects to connect to Oracle 9.2 DB The NLS Language for the Database is AMERICAN_AMERICA.AR8ISO8859P6 the client is using also the same NLS. When I retrive the information using OO4 some varchar2(Arabic Language) are re

  • Installing BP-INSTASS 600V1 and BP-ERP05 600V7

    Hi All, I have to install BP-INSTASS 600V1 and BP-ERP05 600V7  in our QA and Prod. systems. These components are already in our Dev systems. So, to sync three systemscomponetns, I have to install again on our QA and Prod. These components are not the

  • ORA 12528 & ORA 01033

    Well, for some odd reason, I stopped listener services and started again. When I try to connect to database using Oracle SQL Developer, I am getting ORA-12528 Error. Also, I tried logging in using Command Prompt using the UN and password which throws

  • SRM- Cfolders BSP error

    Hi, We are testing SRM- cFolder integration scenario. Vendors are able to access cFolders from outside, internal users are able to access cFolders using URL generated from SICF- cfx. However from SRM server side, whenever purchaser clicks on TechFX -