How to resolve Self Joins in OBIEE

Hi All
Could any one help how to resolve the Self Join relations in OBIEE (ex. "SCOTT.EMP" table has "EMPNO" column which is referenced by "MGR" column in the same table.
Request:
Need to drill down from the Top manager to his employees and so on
Another example can be applied for reporting the Organisation Chart

This is a great article that shows ho to do the Alias:
Adding an Alias table within the BI physical layer using Oracle BI Administration Tool
http://www.mandsconsulting.com/adding-an-alias-table-within-oracle-bi-administration-tool
Thanks
Subra

Similar Messages

  • How to write self join in sql?

    Hi,
    I have table named "table_upload", column "record_type" value "01,03,04....." and start_date,end_date and so on
    And i will have value for  start_date,end_date only for record_type=01,rest of type these two columns will be null.
    now i need to write query with self join, to include above concept. can any one please help me .
    and my query look like follows,

    I just want to re write
    Please provide DDL+DML + expected output!
    and short explanation what is it that we all ask you for:
    DDL = Data Definition Language. In our case that is, CREATE TABLE statements for your tables and other definitions that are needed to understand your tables structure and there for let us to test and reproduce the problem in our server. Without DDL no one
    can execute any query.
    How to get DDL: Right click on the table in Object Explorer and select script table as CREATE. Post these create table scripts here.
    DML = data manipulation language is a family of queries used for manipulating the data it self like: inserting, deleting and updating data. In our case we need some sample data in order to check the query and get result, so we need some indert query for
    sample data.
    If you post a "create table query" for the tables and "insert <table> query" with some sample, then we could help you without Assuming/Guessing. There is a reason that DDL is generally asked for and expected when discussing query problems - it helps
    to identify issues, clarify terminology and prevent incorrect assumptions.  Sample data also provides a common point of reference for the discussion. A script that can be used to illustrate or reproduce the issue you have, will encourage others to help.
    [Personal Site] [Blog] [Facebook]

  • How to Avoid Self Join

    Hi
    Assume I have following table
    Id Code
    1 aa
    1 bb
    1 cc
    2 bb
    2 cc
    The records will be grouped by Id. I want to find out group containing code say 'aa' and 'bb'.
    Is it possible to obtain the desired result in a single query without using Self join?
    Regards
    ~Pravin

    This is a little clumsy....Anyway try it:
    WITH t AS
    (SELECT 1 id,'aa' code FROM dual
    UNION ALL
    SELECT 1,'bb' FROM dual
    UNION ALL
    SELECT 1,'cc' FROM dual
    UNION ALL
    SELECT 2,'bb' FROM dual
    UNION ALL
    SELECT 2,'cc' FROM dual)
    SELECT id FROM t
    WHERE code IN('aa', 'bb')
    GROUP BY id HAVING COUNT(*) = 2;

  • How to tune self join query in Oracle 11g

    Oracle & SQL new to me,and I'm still in learning phase.
    Could you please help me to tune below oracle query?? This table contains ~95 lac records and it takes 1 hour to retrieve data using this query.
    Your suggestions/comments/help will be appreciated.
    Thanks in advance.
    SELECT A.CNO AS CNO, A.FNO AS FNO, A.CID AS CID, A.IID AS IID
    FROM CAC_LKP A, (SELECT C_DATE, CNO, FNO
    FROM (SELECT MAX(CAC_LKP.C_DATE) AS C_DATE, CAC_LKP.CNO AS CNO, CAC_LKP.FNO AS FNO
    FROM CAC_LKP
    WHERE ACTIVE = 'Y' GROUP BY CNO, FNO)) B
    WHERE A.C_DATE = B.C_DATE
    AND A.CNO = B.CNO
    AND A.FNO = B.FNO
    AND A.ACTIVE = 'Y'
    Primary key is defied over combination of c_date,iid,active.
    Edited by: 1009236 on Jun 1, 2013 12:52 AM

    >
    SELECT  A.CNO AS CNO,
            A.FNO AS FNO,
            A.CID AS CID,
            A.IID AS IID
    FROM    CAC_LKP A,
                            SELECT  C_DATE,
                                    CNO,
                                    FNO
                            FROM
                                SELECT  MAX(CAC_LKP.C_DATE) AS C_DATE,
                                        CAC_LKP.CNO AS CNO,
                                        CAC_LKP.FNO AS FNO
                                FROM CAC_LKP
                                WHERE ACTIVE = 'Y'
                                GROUP BY CNO, FNO
                        ) B
    WHERE   A.C_DATE = B.C_DATE     AND
            A.CNO = B.CNO           AND
            A.FNO = B.FNO           AND
            A.ACTIVE = 'Y';Hi,
    Before even starting to see why there is a performance problem, I think you should consider the fact that there is logical problem in your WHERE clause. According to what you mentioned the primary key is composed of *(c_date, iid, active)* yet iid is absent in both the global query's WHERE clause and also that of the subquery.
    Consequently the (aggregate) rows in the subquery will not be linked based on a correct logic to the external query.
    Regards,
    Dariyoosh

  • Self join with fact table in Obie 10G

    I am a newbie to obiee.I have a development requirement as follows-
    I need to find supervisors designation with the existing star RPD design. explanation is below
                                                        DIM_Designation(Desig_Wid)
                                                      |(Row_wid)
                                                      |
    DIM_EMPLOYEE--------WORKER_FACT------------DIM_Supervisor
    (Row_Wid)-----------------(Employee_Wid)
                                      (Supervisor_Wid)------------(Row_Wid)
    3 dimension is joined to fact to get employee, his supervisor and designation of employee. now i want to get the supervisor's designation? how is it possible? already employee and supervisor dimension is same W_employee_d table joined with fact as alias DIM_EMPLOYEE and DIM_SUPERVISOR. how to do self join with fact to get supervisor's designation. i do not have any supervisor_desig_wid in fact table. any help is deeply appreciated.

    Yes,Duplicate the fact table create a primary key on the newly fact table alias dimension table.So you can ur data modelling as usual.

  • Resolve self-reference table by alias tables in detail

    Hello Gurus,
            can you tell me how to resolve self-reference table by alias tables in detail?
    Many thanks.

    Hello, for the following step 3, I don't understand, will you please give me some explanation for step 3?
    Save your Staff universe, and test the results in Web Intelligence Rich Client as follows:
    1. Run a query using Manager and Employee. Add a count on both columns.
    2. Add a query with only the Manager object. Add a count. Is this the correct value?
    3. Open your Staff universe in Universe Designer and edit the Manager object. To ensure
    that the data is restricted to only manager data, use the Tables button. Select the
    EMPLOYEE table, to force the object to use the join between the table and restrict the
    data.
    4. Test the result, creating a new query with only the Manager object. It returns the correct
    number of managers.
    5. Edit the query and add Employee. Run and display the count. There are 26 rows. Why?
    The join restricts the data to look only for employees that have managers. However, there
    is a manager that does not have a manager, and is now excluded.
    6. Open your Staff universe in Universe Designer and add an outer join on the MANAGER
    table side.
    7. Save the changes and test the results in Web Intelligence Rich Client.

  • Rebuilding aMacBook 1.83 GHz Intel Core Duo, hard drive failure so rebuilding system.  Aircard will not stop self-assigning IP address.  Any ideas how to resolve successfully?

    Had hard drive failure on MacBook 1.83 GHz Intel Core Duo, so had to rebuild the OS on new drive. Was on Lion 10.7.5 prior to failure, but had to reinstall Snow Leopard 10.6.3 since that was most recent OS on media I had.  After finally getting ethernet connection to router working, was able to get to internet and download / upgrade to 10.6.8.  I assume I can probably buy the upgrade to Mountain Lion 10.8 from there.
    Problem is this, Airport will not stop self-assigning IP address for my wireless connection, and unless I can get wireless back on this laptop, doesn't make a lot of sense to continue the rebuild and reinstall of all the software that was on it prior to HD failure.  Only way to my home network and router is ethernet now.  Everything else on my network (Apple MacBook Pro laptops, iPhones, desktops, and non-Apple printers and laptops) is hooking up to router wirelessly fine.
    Any ideas how to resolve successfully so that the airport will stop self-assigning and allow the router to assign the IP address?

    When see the beachball cursor, note the exact time: hour, minute, second.  
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    Each message in the log begins with the date and time when it was entered. Scroll back to the time you noted above.
    Select the messages entered from then until the end of the episode, or until they start to repeat, whichever comes first.
    Copy the messages to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of it useless for solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • How to achieve parent-child relationship using self join?

    my table structure is as follows
    parent child name
    -1     1     A1
    1     2     A2
    1     3     A3
    how to achieve the hierarchy model using self join. this can be easily achieved using "connect by prior". but how to achieve the same using self join?

    Hi,
    Yes, that's definitely possible. If you only need to display two levels from the hierarchy, a self-join is a good option. Make it an outer join if you need to show everyone on one level, regardless of whether they have a match on the other level or not; for example, if you want the output:
    child_name     child_id     parent_name     parent_id
    A1          1
    A2          2          A1          1
    A3          3          A1          1It's good that you posted some sample data. Now post the results you want from that data, and your query (what you think is the best attempt you've made so far). If you haven't tried anything so far, then look at some other simple self-join to get ideas.

  • How to implement SCD and outer join in OBIEE

    Hi Experts,
    1.How we can implement SCD1 and SCD2 in OBIEE.
    2. How to implement outer join..? Can we implement outer join in physical layer.?
    Regards
    Frnds

    1. Better to implement this as a part of data warehouse/ETL. If you insist there is explanation on how to work with SCD's in Administrator in some Oracle University Student Book, I think it's for Siebel Analytics version.
    2. Implement outer joins using complex joins in BMM (type option). It's possible to implement in physical layer only in obiee views (new physical table/table type - select), otherwise not, you cannot specify outer join in the physical layer using complex joins.
    Regards
    Goran
    http://108obiee.blogspot.com

  • How to perform a self-join in WebI?

    Post Author: willgreenland
    CA Forum: WebIntelligence Reporting
    I want to perform a self-join on a table in WebI, in order to achieve the following result (of course, if there is another way of doing this I'd be glad to hear it):
    I have a table that lists the department in which an employee is located at given dates in the past:
    EMPLID    DEPT    DATE
    123                Sales    2007...
      I want to use this table to track migration between departments, in other words I want to produce the following output table, showing how in 2008, 5 employees moved from Sales to Marketing (etc):DEPT_A    DATE_A    DEPT_B    DATE_B    COUNT(EMPLID) Sales        2007          Mrkting      2008             5...
    In order to do this in SQL, I would do the following:
    SELECT a.DEPT, b.DEPT, count(distinct EMPLID)FROMEMPL_DEPT a, EMPL_DEPT b        // note the self-join hereWHERE( a.EMPLID = b.EMPLID AND a.DATE = '2007' AND b.DATE = '2008' )GROUP BY a.DEPT, b.DEPT;
    Is there a way of doing this in WebI, ideally without resorting to manual SQL editing (I want this to be a report that other users can make sense of without necessarily getting into the SQL)?

    Post Author: amr_foci
    CA Forum: WebIntelligence Reporting
    you cant do something like that in the WebI directly, you have to manager that at the unvinerse level first
    good luck

  • I m not able to connect for the wifi  which i have used earlier ,i m getting an error as unable to join the network how to resolve this please help me

    i m not able to connect for the wifi  which i have used earlier ,i m getting an error as unable to join the network how to resolve this please help me

    We were able to log in this morning and all is working. You should be able to log in at any point today. Please let us know if you are having any other difficulties.

  • OBIEE 11g SSL how to generate self-signed/demo certificate

    Hi,
    We are enabling SSL for OBIEE 11.1.1.5 environment and want to generate self-signed or demo certificate.
    We are following note 1326781.1 and are at Step 1 - point 4 that says:
    4. Submit the Certification request to your Signing Authority (CA).
    Certification Authority(CA) is an valid signing authority of your choice (for example: OpenSSL, Verisign,
    Microsoft, etc)
    Upon submission of the certificate request, CA returns the certificate for the testmachine server (Server Certificate). Copy the CA certificate and Server Certificate to <MW_HOME>/SSL folder.
    How to gerenate self-signed or demo certificate?
    Thanks in advance.

    As long as you have the keytool on that server (installed with WLS) , you can create the generate the certificate and import that into a keystore.
    Follow : Getting Started with WebLogic Server: How to Create and Configure Self Signed Certificates for WebLogic Server Environments [ID 1341192.1] , describes the two options.
    http://www.techpaste.com/2012/06/steps-configure-ssl-oracle-weblogic-server-custom-identity-java-trust-keystore/
    I am not sure how to generate self signed certs on IBM AIX machine.
    HTH,
    SVS

  • How to resolve many-to-many join by 2 one-to-many joins

    Hi,
       I was asked many times how to resolve many to many relationship between two tables. I read to use 2 one -to- many relationships to resolve this. Can some expalin me when many to many relationship occurs between two tables and how to reslove them with practicle examples. Is there any article on this?
    Regards,
    Nanda Kishore

    Hi,
    Please check below link.
    http://www.forumtopics.com/busobj/viewtopic.php?p=859029&sid=20d79e3df07b0d8b41aadfbd902bb6b2
    http://blog.oaktonsoftware.com/2011/04/bridge-tables-and-many-to-many.html
    Thanks,
    Amit

  • How to re-write this self join update using a CTE

    I would like to improve my performance on this update statement and would like to try re-writing using a CTE:
    UPDATE "usr_sessions" "a" SET "is_ended_at_trustable" = 't'
          WHERE (
            EXISTS (
              SELECT 1
              FROM "usr_sessions" "b"
              WHERE "a"."ended_at" = "b"."started_at"
                AND "a"."usr_space_id" = "b"."usr_space_id"
                AND "a"."account_id" = "b"."account_id"
          ) ) AND "a"."is_ended_at_trustable" IS NULL
    Any help is greatly appreciated!  Open to other suggestions as well if there is a better way!

    If I understood your description correctly, here's a way to accomplish the same thing, while dodging the need for the self join.   The update itself won't be any faster, but the overall query leading to the update will likely be faster sans self-join.
      (If my interpretation wasn't exactly what you meant, tweak the "partition by" clause).
    MERGE is generally considered better then UPDATE, but your particular update isn't at risk for the shortcomings of update (still, Merge is newer, cooler, and more trustworthy).
    Setup_Example_Data:
    Declare @Usr_Sessions table (account_id int, usr_space_id int, is_ended_at_Trustable Char(1), started_at varchar(99), ended_at varchar(99))
    Insert @Usr_Sessions
    Select 1, 10, 't', 'A1', 'A1'
    UNION ALL Select 2, 20, 'f', 'B1', 'B2'
    UNION ALL Select 3, 30, NULL, 'C1', 'C1'
    UNION ALL Select 4, 40, NULL, 'D1', 'D2'
    UNION ALL Select 5, 50, NULL, 'E1', 'E2'
    UNION ALL Select 5, 51, NULL, 'E3', 'E3'
    UNION ALL Select 6, 61, NULL, 'F1', 'F2'
    UNION ALL Select 6, 62, 't', 'F3', 'F3'
    UNION ALL Select 6, 62, 'f', 'F4', 'F4'
    Select 'Before', * from @Usr_Sessions
    OP_Query:
    BEGIN TRAN
    UPDATE A SET is_ended_at_trustable = 't' from @usr_Sessions A-- Select * from @Usr_Sessions "a" --
    WHERE (
    EXISTS (
    SELECT 1
    FROM @usr_sessions "b"
    WHERE "a"."ended_at" = "b"."started_at"
    AND "a"."usr_space_id" = "b"."usr_space_id"
    AND "a"."account_id" = "b"."account_id"
    ) ) AND "a"."is_ended_at_trustable" IS NULL
    Select 'After 1', * from @Usr_Sessions
    ROLLBACK TRAN /* Just to reset test data to original form, so second query below runs against original data */
    Dodge_Self_Join:
    With X as
    Select *
    , count(case when started_at = ended_at and is_ended_at_trustable is null then 'x' else null end)
    over(partition by account_id, usr_space_id) as Updatable
    From @Usr_Sessions
    Update X
    set is_ended_at_Trustable = 'T'
    where Updatable > 0 -- EDIT -- fixed error, previously said "updatable = 1"
    Select 'After 2', * from @Usr_Sessions

  • How to Resolve Join Syntax Errors in Crystal Reports 11.5

    Weu2019re upgrading form Crystal Reports Runtime Client 10.0 to 11.5.  I have a registry fix that resolves the join syntax errors in Crystal Reports 10.0 by updating the registry key:
    [HKEY_LOCAL_MACHINE\Software\Crystal Decisions\10.0\Crystal Reports\Database\QueryBuilder\JoinBuilder]
    "SQLServerJoinBuilder"="adbc"
    What is the fix for Crystal Runtime 11.5?

    Create a new key under:
    HKEY_CURRENT_USER\Software\Business Objects\Suite 11.5\Crystal Reports\Database\QueryBuilder\JoinBuilder and add the values
    "SQLServerJoinBuilder"="adbc"

Maybe you are looking for

  • Repeated prompts to install with "Installation Failed" error - ANNOYING

    I've been experiencing the same issue for the better part of July and August.  I have tried several recommended strategies in the hopes of getting Adobe Flash Player (AFP) to install and perform correctly; however, none of my attempts have led to AFP

  • Parallel processing in Info package

    Hi All, I want to increase the parallel processing for pulling the data from R/3 to PSA. I dont find any options available in Info package. Like DTP, is there any options available to increase the parallel processing from R3 to PSA. Please suggest ho

  • Clean up the database (Lists) help please

    Hello everyone I have been fudging my way through BC for a few years now, I am a business owner who is a graphic designer but does not know a lot about code. So, i have sent loads of email campaigns to many different lists over the years with just th

  • Aperture update to 3.4.5 fails

    I want to update Aperture from 3.1.1 to 3.4.5 on my Macbook Pro but it does not work. The app store shows me no updates. If I want to install the package 3.4.5 it fails with the message that the version 3.0.0 is required for the update but I have ver

  • Teststand 4.1.1 PAWS Run-Time System ActiveX Server

    Hello, I downloaded Teststand 4.1.1 for evaluation. However, when I tried to run the example called "Manual Intervention Example.seq" or "ParameterPassingExample.seq" shows an error. Both sequences indicates "PAWS Run-Time System ActiveX Server not i