About Cross Join

When I'm seeing an article about cross join I got a doubt. In that physical diagram they connected the the column-1 from table A and column 2 from table B.Table-A is xls and table-2 is Oracle.
Now IN BMM layer they connected the col-1 and col-2 as foreign key join. I think In BMM layer we prefer to do complex join. Any idea to get an idea
Thanks & Regards,
Pallis

Hi Pallis,
Check my blog regarding joins; http://obibb.wordpress.com/2010/08/06/joins-in-oracle-bi-ee/
From Answers a Logical query is fired. The BI Server fires two Physical queries to the seperate databases. The results of the two seperate queries are stiched toghether by the BI Server and presented in Answers.
Cheers,
Daan Bakboord
http://obibb.wordpress.com

Similar Messages

  • Illegal cross join within the same dimension caused by incorrect subject ar

    hi!
    Imagine the following BMM:
    There is one Logical Dimension Table "Service Account" with the following LTS:
    - LTS "D_SERVICE"
    - LTS "D_SERVICE_CLASS"
    - LTS "D_SERVICE_STATUS"
    This Logical Tabe "Service Account" joins (One-to-many) with several Fact Tables (other Logical Tables).
    In the Physical Layer the joins for the "Service Account" LTS are:
    - One-to-many between D_SERVICE_CLASS and D_SERVICE
    - One-to-many between D_SERVICE_STATUS and D_SERVICE
    The problem is that when I build a report in Answers using only the following columns of the Logical Table "Service Account":
    - Service Class Desc (which exists in the Logical Table "Service Account" and in the Physical Table D_SERVICE_CLASS)
    - Service Status Desc (which exists in the Logical Table "Service Account" and in the Physical Tabl D_SERVICE_STATUS)
    - MSISDN (which existis in the Logical Table "Service Account" and in the Phsyical Table D_SERVICE)
    the following error appears:
    Estado: HY000. Código: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [ (select * from prd.D_SERVICE where SOURCE_SYS in ('ARBOR','PPB') and DW_SERV_ST_ID in (100000003,100000009)) as T1836, D_SERVICE_CLASS T1916] with [ D_SERVICE_STATUS T1948] (HY000)
    SQL emitido: SELECT "SERVICE ACCOUNT"."TLC MSISDN9" saw_0, "SERVICE ACCOUNT"."IWS Service Class Desc" saw_1, "SERVICE ACCOUNT"."TLC Service Status Desc" saw_2 FROM "VFPT - Upgrade Siebel" WHERE "SERVICE ACCOUNT"."TLC MSISDN9" = '917330340' ORDER BY saw_0, saw_1, saw_2
    Help, please!
    Thanks.

    Physically, only D_SERVICE is joined to the facts. Then D_SERVICE_CLASS is joined to D_SERVICE (one-to-many) and D_SERVICE_STATUS is joined also to D_SERVICE (one-to-many).
    In the BMM, there is only one Logical Dimension Table for those 3 physical tables. This Logical Dimension Table is called "Service Account" and has 3 LTS: D_SERVICE, D_SERVICE_CLASS, D_SERVICE_STATUS. The Logical Dimension Table has several logical columns that are associated to those 3 LTS: SERVICE_KEY, SERVICE_CLASS_KEY, SERVICE_STATUS_KEY, SERVICE_MSISDN, SERVICE_CLASS_DESC, SERVICE_STATUS_DESC.
    The Logical Dimension Table "Service Account" is then joined to a fact table (one-to-many).
    I didn't understand the suggestion about the 3 LTS... Aren't we doing that already? Can you explain it better, please?
    thanks.

  • How to resolve illegal cross join error

    Can someone please tell me how can we avoid illegal cross join error in modeling? If someone has any reference document , please share it.
    I have 5 tables - Dim (A, B , C,E) and Fact( D). C is lookup table which is used to resolve the lookup code column in table E.
    The relationships between these are
    A--< B--< E >--C
    & A--<D
    My requirement is i have to expose Attributes of A,B ,C & E within Dimension.
    These attributes (from B,C,E) will be treated as property of A.
    Someone may query these attributes without selecting any column from fact table.
    Thanks & Regards,
    Ashish

    Hi Ashish,
    it's not the first time you come up with this kind of question and I'm wondering if you understand the principle of granularity when I read your questions.
    On physical level, a fact table must always join with the lowest level of detail of your dimension table. Let me explain, by giving an example which looks like your situation.
    Assume I have three tables:
    Table "E" contains products, which has attributes like: product_id and product_name
    Table "B" contains order line items, which has attributes like: order_line_item_id, order_id and product_id.
    Table "A" contains orders, which has attributes like: order_id and customer_name.
    Table "D" contains facts ("metrical data") about my order: which has attributes like: order_id, order_revenue.
    This will be the diagram on physical level: E--<B--<A--<D
    Here are my joins: E.product_id on B.produc_id, B.order_id on A.order_id, A.order_id--<D.order_id
    Now, my question to you is: will I be able to get the revenue of a certain product?
    The answer is: No, because I don't know what part of my order is spent on a certain product. The problem is thus that the data in the fact table isn't stored on that level of detail, or in other words the fact and dimension table don't share the same level of granularity.
    How it should be:
    If you want to get the revenue per product, you will need to have a second fact table "G", which has data which is stored on order line item level. This table contains the following attributes: order_line_item_id, product_id and order_line_item_revenue.
    This will become your diagram on physical level:
    B--<G>--E
    Joins: B.order_line_item_id on G.order_line_item_id and E.product_id on G.product_id
    Table E has become a dimension of fact table G.
    The first physical diagram should look like this:
    A--<D
    If you want you can model both physical diagrams into one logical diagram, assuming that A and D (order dimension and fact table) are aggregates of B and G (order line items dimension and fact table). In that case you should read this blog item: http://obiee101.blogspot.com/2008/11/obiee-making-it-aggregate-aware.html
    Regards,
    Stijn

  • Cross join of dimensions

    Hi,
    For example:  two dimension tables and one fact table.
    dim1: branch
    branch1
    branch2
    dim2: time
    day1
    day2
    fact: sales
    branch1, day2, 100
    what I want in answers when using branch and time and sales without any filters:
    Branch1, day1, 0
    branch1, day 2, 100
    Branch 2, day1, 0
    Branch 2, day 2, 0
    so basically I want to keep all dimensions combinations and related facts or 0 if there is no related facts. How to do it?
    I know how to do it for just one dimension.  That is to set up the relationship between the dimension and the fact as outer join. But how about two or more dimensions?
    In SQL it will be something like dimension 1 cross join dimension 2 then left outer join the fact.  How to do it in OBIEE 10 G?

    And I have tried set branch - fact and time - fact as outer join. In answers,
    1. select time and sales
    day1, null
    day2, 100
    2. select branch and sales
    branch1, 100
    branch2, null
    3. select branch, time , and sales
    branch 1, day 2, 100
    branch 2, null, null

  • Non equijoin and cross join

    I tried learning about nonequi join and cross join.
    When I try non equi join "select * from emp,dept;"...I am getting total of 60 rows.
    when I try cross join "select * from emp cross join dept"...I am getting same count(60 rows) and same output.
    Can anypone please give me the exact difference between the above joins.
    Which cases they are used.
    Thanks

    Hi,
    user11048416 wrote:
    I tried learning about nonequi join and cross join.
    When I try non equi join "select * from emp,dept;"...I am getting total of 60 rows.
    when I try cross join "select * from emp cross join dept"...I am getting same count(60 rows) and same output.
    Can anypone please give me the exact difference between the above joins.Those two are exactly the same. The first one is Oracle's older notation, the other second (using the keywords CROSS JOIN) is ANSI syntax, which Oracle started supporting in version 9.
    Which cases they are used.By far, the most common occurrence of cross joins is when someone forgets to add join conditions in the older syntax. That's one reason why ANSI syntax is better.
    There are real uses, but they are not very common, and getting rarer.
    If one of the tables (usually a result set, not a full table) has only one row, it's a way to add the columns of that "table" to another result set.
    Cross-joins are also used for partitioned outer joins (where you want one row for each combination of attributes, whether or not it actually occurs in the data) and unpivots displaying several columns from the same row as if they were one column on several rows). In Oracle 11, there are cleaner ways for doing both of these.

  • Cross Join or Cartesian Product

    Hi Expert,
    I'm not sure if I'm posting in the right place, because this problem involve between BW/BEx, Universe and BO; but I think there's a possibility 'a wrong' in the universe.
    Right now I want to create a report in Webi from BEx Query via Universe.
    When I put 2 query item in Webi, let's say, PERNR and TRFST. The result looks like this (example) :
    PERNR         TRFST
    12345            S1
    12345            S2
    54321            S1
    54321            S2
    Ok, that's the appetizer. Here's the main course.
    For some reason, I'm using function module in ABAB to create a data source table as transaction data in BW. I create a Fact Table that contain all field that I need to create dimension tables. This, in my opinion, for eliminate the possibility that the cross join appear because there's something wrong in the relationship between the dimension and the fact when creating the cube. This is a little example of my Cube result :
    PERNR        TRFST        KEY FIGURE
    12345            S1            XXX
    54321            S2            ZZZ
    As I explain above, I create Person dimension and TRFST (in my case I called 'Eselon') dimension and 1 Key Figure. So, from here, I assumed that there's no problem with the BW because the cube resulted the content as I'm expected.
    Then I moved to BEx designer. I create a query from that cube, creating a pivot table that contain Person, Eselon, and the key figure. When I open the query in the BEx Analysis, the excel create a pivot table like this :
                           KEY FIGURE
    12345    S1       XXX
    Result               XXX
    54321    S2      ZZZ
    Result               ZZZ
    From here, again I assumed, there's no problem in BEx, since there's no cross join between the dimension. Then I create the universe, then I tried to create the Webi report, and DANG!! a cross join appear.
    Did you guys have any idea or solution about this? This is for the first time I created a universe using BEx, so maybe I miss something.
    I will appreciate every helpful comment from you
    Thank You
    Rully

    Well.. ummm.. actually I don't using 2 query nor 2 data provider for my report. It came from 1 query. But that's ok. It's just misunderstanding between us. Maybe because I'm using the '2 query item' word. I'm sorry.
    Just for your information, finally I can solve it. Like I said in the first post, I'm just trying to use 2 characteristic (I think this is better word rather than query item), but I don't pull the key figures to the report. When I put at least 1 key figure to the report, pam pam pa ra pam... the cross join gone. I don't know why, but it happen.
    Than, I examine this case by creating a simple report using eFashion universe. When I put 2 characteristic without key figure, there's no cross join. I don't know why, but it happen.
    well, thank you for your comment, even mostly there are misunderstanding, but I really appreciate it. Thank you.
    Rully

  • Cross Join Records - only want the "latest valid" records depending on Shop-Level

    Hi everyone,
    I have a problem with the cross join for my retail application.
    Initial Situation:
    There are several Shops and in also several products. Usually the products are just created on global level so that all shops can access and sell them.
    BUT there is a feature, that single shops can create derivations of articles to change some settings for them (e.g. a the price of a certain handy is global 90€ but in one flagship store the price is 80€).
    Sample Tables
    create table shops(
    id number,
    name varchar2(64) not null,
    hierarchy varchar2(64) not null,
    parent number,
    PRIMARY KEY (id));
    create table articles(
    id number,
    name varchar2(64) not null,
    price number,
    shop_id number not null,
    PRIMARY KEY (id));
    -- create 4 shops with the hierarchy
    - Global
        |- Shop A
        |- Shop B
              |- Shop B.1
    insert into shops values (0, 'Global', '.0.', null);
    insert into shops values (1, 'Shop A', '.0.1.', 0);
    insert into shops values (2, 'Shop B', '.0.2.', 0);
    insert into shops values (3, 'Shop B.1', '.0.2.3.', 2);
    -- insert some articles + derive the 'Article 2' for shop B.1
    insert into articles values (0, 'Article 1', 100, 0);
    insert into articles values (1, 'Article 2', 90, 0);
    insert into articles values (2, 'Article 2', 80, 3); -- derive article 2 for the shop 2 and set price to 80 instead of 90
    Sample Statements
    -- restrict to 'Article 1' where no derivations exists
    select s.*, a.*
    from shops s, articles a
    where s.hierarchy like '%.' || a.shop_id || '.%' -- ensures that derivations only appear at the level of the shop and not for each shop
    and a.name = 'Article 1';
    The result gets the one article for each shop. So I have no problem to restrict to a shop id, and getting the article even if it's not created for that shop level.
    Shop ID
    Shop Name
    Hierarchy
    Parent
    Article ID
    Article Name
    Price
    Article Shop ID
    0
    Global
    .0.
    null
    0
    Article 1
    100
    0
    1
    Shop A
    .0.1.
    0
    0
    Article 1
    100
    0
    2
    Shop B
    .0.2.
    0
    0
    Article 1
    100
    0
    3
    Shop B.1
    .0.2.3.
    2
    0
    Article 1
    100
    0
    -- restrict to 'Article 2' where one derivation exists
    select s.*, a.*
    from shops s, articles a
    where s.hierarchy like '%.' || a.shop_id || '.%' -- ensures that derivations only appear at the level of the shop and not for each shop
    and a.name = 'Article 2';
    The result of this statement shows, that the "Article 2" is contained two times for the ShopID 3. This is because the Article exists two times in the articles table.
    Shop ID
    Shop Name
    Hierarchy
    Parent
    Article ID
    Article Name
    Price
    Article Shop ID
    0
    Global
    .0.
    null
    1
    Article 2
    90
    0
    1
    Shop A
    .0.1.
    0
    1
    Article 2
    90
    0
    2
    Shop B
    .0.2.
    0
    1
    Article 2
    90
    0
    3
    Shop B.1
    .0.2.3.
    2
    1
    Article 2
    90
    0
    3
    Shop B.1
    .0.2.3.
    2
    2
    Article 2
    80
    3
    Problem1
    The last result shows my problem very well. I just want to get the highest level of article if there are any derivations.
    Problem2
    The solution must be very fast, because I have about
    3.000 Shops and about
    700.000 different Articles (on global level)
    Can somebody help my to find a performant solution for my problem?

    Hi,
    In the output for 'Article 2', do you really want prices of 100 and 65?  I assume you meant 90 and 80, like this:
                                                               ARTICLE
    SHOP SHOP                         ARTICLE ARTICLE          _SHOP
    _ID _NAME      HIERARCHY  PARENT _ID     _NAME      PRICE _ID
       0 Global     .0.               1       2          90    0
       1 Shop A     .0.1.           0 1       2          90    0
       2 Shop B     .0.2.           0 1       2          90    0
       3 Shop B.1   .0.2.3.         2 2       2          80    3
    Here's how I got the output above:
    WITH   joined_data     AS
        SELECT    s.id      AS shop_id
        ,         s.name    AS shop_name
        ,         s.hierarchy
        ,         s.parent
        ,         a.id AS article_id
        ,         a.name AS article_name
        ,         a.price
        ,         a.shop_id AS article_shop_id
        FROM             shops     s
        LEFT OUTER JOIN  articles  a  ON   a.shop_id  = s.id
                                      AND  a.name     = 'Article 2'  -- or whatever
    SELECT    shop_id
    ,         shop_name
    ,         hierarchy
    ,         parent
    ,         REGEXP_SUBSTR ( SYS_CONNECT_BY_PATH (article_id, '/')
                            , '(\d+)/*$'
                            , 1, 1, NULL, 1
                            )    AS article_id
    ,         REGEXP_SUBSTR ( SYS_CONNECT_BY_PATH (article_name, '/')
                            , '(\d+)/*$'
                            , 1, 1, NULL, 1
                            )    AS article_name
    ,         REGEXP_SUBSTR ( SYS_CONNECT_BY_PATH (price, '/')
                            , '(\d+)/*$'
                            , 1, 1, NULL, 1
                            )    AS price
    ,         REGEXP_SUBSTR ( SYS_CONNECT_BY_PATH (article_shop_id, '/')
                            , '(\d+)/*$'
                            , 1, 1, NULL, 1
                            )    AS article_shop_id
    FROM      joined_data
    START WITH  parent IS NULL
    CONNECT BY  parent = PRIOR shop_id
    Like everything else in Oracle, it depends on your version.
    I used '/' as a delimiter, assuming that character never occurs in the article_name, article_id, price or shop_id.  If '/' can occur in any of those columns, you can use any other character as a delimiter.  You don't have to use the same delimiter for all 4 columns, but remember to use the same delimiter in REGEXP_SUBSTR that you use in its nested SYS_CONNECT_BY_PATH.
    Instead of doing 4 very similar REGEXP_SUBSTR (SYS_CONNECT_BY_PATH ... ) calls, you could do just 1, for article_id, and then join to the articles table to get the other columns.  I suspect that the way I posted above is faster.

  • Cross Join in Power Query

    Is it possible to create a cross join between queries in Power Query?
    I plan to use a table holding budgetlines that i want to cross join with a timetable to create monthly budgetlines.
    Thanks, Menno van Leewen

    Hi Menno,
    Yes, it's possible to perform different kinds of join operations in Power Query, including a cross join. Please check out this page for more information on the different options,
    http://office.microsoft.com/en-us/excel-help/table-join-HA104112136.aspx
    The library specification also contains a description about the different Join Kinds (around page 164):
    http://office.microsoft.com/en-us/excel-help/learn-about-power-query-formulas-HA104003958.aspx?CTT=5
    According to your description, I think you will want to do a full outer join. It should look similar to this:
    Table.Join(Customers, "CustomerID",Table.PrefixColumns(Orders, "Order"), "Order.CustomerID", JoinKind.FullOuter)
    Thanks,
    M.

  • [8i] Need help with full outer join combined with a cross-join....

    I can't figure out how to combine a full outer join with another type of join ... is this possible?
    Here's some create table and insert statements for some basic sample data:
    CREATE TABLE     my_tab1
    (     record_id     NUMBER     NOT NULL     
    ,     workstation     VARCHAR2(4)
    ,     my_value     NUMBER
         CONSTRAINT my_tab1_pk PRIMARY KEY (record_id)
    INSERT INTO     my_tab1
    VALUES(1,'ABCD',10);
    INSERT INTO     my_tab1
    VALUES(2,'ABCD',15);
    INSERT INTO     my_tab1
    VALUES(3,'ABCD',5);
    INSERT INTO     my_tab1
    VALUES(4,'A123',5);
    INSERT INTO     my_tab1
    VALUES(5,'A123',10);
    INSERT INTO     my_tab1
    VALUES(6,'A123',20);
    INSERT INTO     my_tab1
    VALUES(7,'????',5);
    CREATE TABLE     my_tab2
    (     workstation     VARCHAR2(4)
    ,     wkstn_name     VARCHAR2(20)
         CONSTRAINT my_tab2_pk PRIMARY KEY (workstation)
    INSERT INTO     my_tab2
    VALUES('ABCD','WKSTN 1');
    INSERT INTO     my_tab2
    VALUES('A123','WKSTN 2');
    INSERT INTO     my_tab2
    VALUES('B456','WKSTN 3');
    CREATE TABLE     my_tab3
    (     my_nbr1     NUMBER
    ,     my_nbr2     NUMBER
    INSERT INTO     my_tab3
    VALUES(1,2);
    INSERT INTO     my_tab3
    VALUES(2,3);
    INSERT INTO     my_tab3
    VALUES(3,4);And, the results I want to get:
    workstation     sum(my_value)     wkstn_name     my_nbr1     my_nbr2
    ABCD          30          WKSTN 1          1     2
    ABCD          30          WKSTN 1          2     3
    ABCD          30          WKSTN 1          3     4
    A123          35          WKSTN 2          1     2
    A123          35          WKSTN 2          2     3
    A123          35          WKSTN 2          3     4
    B456          0          WKSTN 3          1     2
    B456          0          WKSTN 3          2     3
    B456          0          WKSTN 3          3     4
    ????          5          NULL          1     2
    ????          5          NULL          2     3
    ????          5          NULL          3     4I've tried a number of different things, googled my problem, and no luck yet...
    SELECT     t1.workstation
    ,     SUM(t1.my_value)
    ,     t2.wkstn_name
    ,     t3.my_nbr1
    ,     t3.my_nbr2
    FROM     my_tab1 t1
    ,     my_tab2 t2
    ,     my_tab3 t3
    ...So, what I want is a full outer join of t1 and t2 on workstation, and a cross-join of that with t3. I'm wondering if I can't find any examples of this online because it's not possible....
    Note: I'm stuck dealing with Oracle 8i
    Thanks!!

    Hi,
    The query I posted yesterday is a little more complicated than it needs to be.
    Since my_tab2.workstation is unique, there's no reason to do a separate sub-query like mt1; we can join my_tab1 to my_tab2 and get the SUM all in one sub-query.
    SELECT       foj.workstation
    ,       foj.sum_my_value
    ,       foj.wkstn_name
    ,       mt3.my_nbr1
    ,       mt3.my_nbr2
    FROM       (     -- Begin in-line view foj for full outer join
              SELECT        mt1.workstation
              ,        SUM (mt1.my_value)     AS sum_my_value
              ,        mt2.wkstn_name
              FROM        my_tab1   mt1
              ,        my_tab2   mt2
              WHERE        mt1.workstation     = mt2.workstation (+)
              GROUP BY   mt1.workstation
              ,        mt2.wkstn_name
                    UNION ALL
              SELECT      workstation
              ,      0      AS sum_my_value
              ,      wkstn_name
              FROM      my_tab2
              WHERE      workstation     NOT IN (     -- Begin NOT IN sub-query
                                               SELECT      workstation
                                       FROM      my_tab1
                                       WHERE      workstation     IS NOT NULL
                                     )     -- End NOT IN sub-query
           ) foj     -- End in-line view foj for full outer join
    ,       my_tab3  mt3
    ORDER BY  foj.wkstn_name
    ,       foj.workstation
    ,       mt3.my_nbr1
    ,       mt3.my_nbr2
    ;Thanks for posting the CREATE TABLE and INSERT statements, as well as the very clear desired results!
    user11033437 wrote:
    ... So, what I want is a full outer join of t1 and t2 on workstation, and a cross-join of that with t3. That it, exactly!
    The tricky part is how and when to get SUM (my_value). You might approach this by figuring out exactly what my_tab3 has to be cross-joined to; that is, exactly what should the result set of the full outer join between my_tab1 and my_tab2 look like. To do that, take your desired results, remove the columns that do not come from the full outer join, and remove the duplicate rows. You'll get:
    workstation     sum(my_value)     wkstn_name
    ABCD          30          WKSTN 1          
    A123          35          WKSTN 2          
    B456          0          WKSTN 3          
    ????          5          NULL          So the core of the problem is how to get these results from my_tab1 and my_tab2, which is done in sub-query foj above.
    I tried to use self-documenting names in my code. I hope you can understand it.
    I could spend hours explaining different parts of this query in more detail, but I'm sure I'd waste some of that time explaining things you already understand. If you want an explanation of somthing(s) specific, let me know.

  • OBIEE: non empty cross join function problem with some reports

    Hi all,
    I am getting some problem ,when we are excuting some requests in OBIEE its taking long time , Actually our OBIEE is connected with Essbase when we are generating some reports its taking long time so i captured the Query in OBIEE and Iam excuting that query in Essbase MDX editor
    its having the the function " NON EMPTy CROSS JOIN"
    which reports having non empty crossjoin function its taking long time so how can i disable this function in OBIEEfor that reports
    I dont want to use that function for my reports so how can i do this in OBIEE
    your help would be appriciated.
    Thanks
    Edited by: user8815661 on 26 mai 2010 08:44

    Any Help

  • How to avoid duplicates in CROSS JOIN Query

    Hi,
    I am using CROSS JOIN to get all the subset of a table col values as shown below:
    PRODUCT (Col Header)
    Bag
    Plate
    Biscuit
    While doing cross join we will get as
    Bag Bag
    Bag Plate
    Bag Biscuit
    Plate Bag
    Plate Plate
    Plate Biscuit ..... like this
    By placing where condition prod1 <> prod2 to avoid Bag Bag and Plate Plate values. So the output will be like below
    Bag Plate
    Bag Biscuit
    Plate Bag
    Plate Biscuit
    Now "Bag Plate" and "Plage Bag" are same combination how to avoid these records. My expected result is
    Bag Biscuit
    Plate Biscuit
    How to derive this ?
    Sridhar

    Hi,
    This is the the solution that I found as fit to the OP question, but
    Visakh16 already posted the same idea (assuming the names are unique) from the start and I don't think that anyone notice it!
    Sridhar.DPM did
    you check Visakh16's response
    (the second response received)?!?
    I will mark his response as an answer. If this is not what you need pls clarify and you can unmark it :-)
    [Personal Site] [Blog] [Facebook]

  • About inner join in abap

    hi
        i am new to sap , i dont no about inner join in abap coding
    plz send me some notes or coding.
                            thank u.
                                                              your regrads
                                                                    divya.

    hi
    use this links
    INNER JOIN  and OUTER JOINhttp://help.sap.com/erp2005_ehp_03/helpdata/EN/cf/21ec77446011d189700000e8322d00/frameset.htm
    JOINED TABLES
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/0f/49bd6a5d5049edba7b3afe6c7956e3/frameset.htm
    u will find all thins related to joins with example and how to use it
    Cheers
    Snehi
    Edited by: snehi chouhan on Jul 25, 2008 9:45 AM

  • [nQSError: 14065] Illegal cross join

    I am getting the following the following error “[nQSError: 14065] Illegal cross join” in the following situation.
    We have one dimension table Called “WC_CUSTOMER_D” and in that table we are storing 2 row_wids one to store the “Status Wid” (data comes from WC_LOV_D) and “Risk Wid” (again data comes from WC_LOV_D) of the customer . We have 2 alias table as Dim_Status_WC_LOV_D and Dim_Risk_WC_LOV_D and it joins to the Dim_WC_CUSTOMER_D .
    In Logical we have one Logical table “Dim Customer” and has 3 Logical table source (reason is we can write content level filters ) for the each dimension tables. We exposed some attributes from the Dim_WC_CUSTOMER_D, Dim_status_WC_LOV_D and Dim_Risk_WC_LOV_D tables.
    In answer , We are getting the illegal cross join error when we expose fields from 2 WC_LOV_D alias tables
    Error comes only if we use alias of same physical type more than once
    Query Status: Query Failed: [nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [
    WC_CUSTOMER_D T624599,
    WC_LOV_D T624699] with [
    WC_LOV_D T628734]
    But when I add a fact , BI is able to build a query
    select T624599.SOURCE_SYSTEM as c1,
    T624699.LOOKUP_CODE as c2,
    T628734.LOOKUP_CODE as c3,
    count(distinct T623979.CUST_ACCT_WID) as c4
    from
    WC_LOV_D T628734 /* Dim_Risk_WC_LOV_D_ */ ,
    WC_LOV_D T624699 /* Dim_Staus_WC_LOV_D */ ,
    WC_CUSTOMER_D T624599 /* Dim_W_CUSTOMER_D */ ,
    WC_CUSTOMER_F T623979 /* Fact_WC_CUSTOMER_F */
    where ( T623979.CUST_FIN_PROFL_WID = T624599.ROW_WID and T624599.X_ACCOUNT_STATUS_WID = T624699.ROW_WID and T624599.X_RISK_CODE_WID = T628734.ROW_WID and T628734.LOOKUP_TYPE = 'RISK' and T624699.LOOKUP_TYPE = 'STATUS' )
    group by T624599.X_ SOURCE_SYSTEM, T628734.LOOKUP_CODE, T624699.LOOKUP_CODE
    order by c1, c2, c3
    Please guide me if I did some mistake or any work around for this issue.
    Thanks
    Barna

    Hi,
    Maybe you have already resolved this issue. In any case, I found a solution following instructions in support note ID 1329237.1.
    Best regards,
    Cristina

  • [nQSError: 14065] Illegal cross join within the same dimension

    Hey guys,
    I'm stumped. I have two dimension tables that are joined 1:N (there is NOT an M:N relationship between them) and I have them joined in the Physical Layer and the Business Model and Mapping Layer. The two tables are F4101 (the "1") and F4102 (the "N") in the 1:N relationship. F4102 then joins to a fact table, and F4101 joins to NOTHING else. So I don't believe I have a circular condition or a need for a bridge table. Both tables are published to the Presentation Layer for reporting.
    The error occurs in Answers when I want to do something as trivial as display the three primary key columns together from F4101: F4101.col1, F4101.col2, F4101.col3 (all three make up the PK). When I do that, the following error occurs:
    "nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [ F4101 T28761] with [ F4102 T1805] "
    What I can't figure out is WHY the F4102 table is listed in this error. I didn't try to report on it at all. See the logical SQL below from my query:
    "SQL Issued: SELECT "Item Master (F4101)".IMITM saw_0, "Item Master (F4101)".IMLITM saw_1, "Item Master (F4101)".IMAITM saw_2 FROM "Sales Analysis" ORDER BY saw_0, saw_1, saw_2"
    As soon as I take out one of the three PK columns and add in another non-PK column from F4101, it works just fine. And reporting on each of the three PK columns individually works as well in Answers.
    Any ideas? I would greatly appreciate it.
    Thanks.

    Try this;
    1. In the logical layer, create one folder called F4101_F4102.
    2. Map both F4101 and F4102 as logical table sources in that folder.
    3. Join from the folder F4101_F4102 to the fact using a Logical (new complex join) join.
    Chris.

  • Cross Join in ABAP Open SQL

    Hi guys!
    I need to implement a CROSS JOIN (cartesian product) based on two tables. To my understanding there is no construct to implement a cross join in OPEN SQL. So the question is first is this correct? And secondly in which way would you then implement a cross join of two tables with the constructs at hand in ABAP?
    I have come up with the following solution of cross joining two tables, but would like to know if there is a better (not so ugly way).
    Example:
    SELECT * FROM tab1 AS t1 JOIN tab2 AS t2 ON t1mandt = t2mandt INTO CORRESPONDING FIELDS OF itab.
    Note that this only works if the tables tab1 and tab2 is client dependent.
    Regards,
    Christian

    Christian,
      There's no cross join construct in abap. Join statement results in a cartesin product rarely because of completely obsolete statistics missing selection or join conditions.
    Try the following join to get result similar to cartesian product
    select tab1location tab2matnr into itab
      from tab1 join tab2 on tab1location ne tab2matnr.
    if you really want to implement cross join, use native sql, try the following code,
    beware of cartesian products, Basis folks doesn't like em....
    data: begin of itab occurs 0,
      loc like tab1-sloc
      matnr like tab2-matnr,
    end of itab.
    exec sql performing append_itab.
      select a.loc, b.matnr
        into :itab
        from tab1 a
        cross join tab2 b
    endexec.
    form append_itab.
      append itab.
    endform.               
    Regards
    Sridhar.

Maybe you are looking for