Script populate parent-child hierarchy not running

Hallo guys
I have problem when running script populate Parent-Child Relationship Table.
Here is the script.I don't even change the script.just run it in PL/SQL
declare
v_max_depth integer;
v_stmt varchar2(32000);
i integer;
begin
select max(level) into v_max_depth
from V_D_BRANCH
connect by prior BRANCH_KEY=PARENT_BRANCH_KEY
start with PARENT_BRANCH_KEY is null;
v_stmt := 'insert into DM_ANALYTICS.BRANCH_HIERARCHY (MEMBER_KEY, ANCESTOR_KEY, DISTANCE, IS_LEAF)
            select BRANCH_KEY as member_key, null, null, 0 from V_D_BRANCH where PARENT_BRANCH_KEY is null
            union all
            select  member_key,
            replace(replace(ancestor_key,''\p'', ''|''), ''\'', ''\'') as ancestor_key,
            case when depth is null then 0
            else max(depth) over (partition by member_key) - depth + 1
            end as distance, is_leaf
from
select member_key,depth,
case     when depth is null then '' || member_key
when instr(hier_path, ''|'', 1, depth + 1) = 0 then null
   else substr(hier_path, instr(hier_path, ''|'', 1, depth) + 1, instr(hier_path, ''|'', 1, depth + 1) - instr(hier_path, ''|'', 1, depth) - 1)
end ancestor_key,
is_leaf
from
    (    select BRANCH_KEY as member_key, PARENT_BRANCH_KEY as ancestor_key, sys_connect_by_path(replace(replace(BRANCH_KEY, ''\'', ''\''), ''|'', ''\p''), ''|'') as hier_path,
      case when BRANCH_KEY in (select PARENT_BRANCH_KEY from V_D_BRANCH ) then 0 else 1 end as IS_LEAF
from V_D_BRANCH 
connect by prior BRANCH_KEY = PARENT_BRANCH_KEY
start with PARENT_BRANCH_KEY is null
  ( select null as depth from dual;
for i in 1..v_max_depth - 1 loop
v_stmt := v_stmt || union all select '' || i || '' from dual;
end loop;
v_stmt := v_stmt || ) )
where ancestor_key is not null;
execute immediate v_stmt;
end;
but I got errors like following:
Error report -
ORA-06550: line 19, column 12:
PLS-00103: Encountered the symbol "insert into DM_ANALYTICS.BRANCH_HIERARCHY (MEMBER_KEY, ANCESTOR_" when expecting one of the following:
   ( - + case mod new not null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable>
   continue avg count current exists max min prior sql stddev
   sum variance execute forall merge time timestamp interval
   date <a string literal with character set specification>
   <a number> <a single-quoted SQL string> pipe
   <an alternatively-quoted string
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:
what should I do guys?any idea,any solution would be appreciated.thanks alot guys

956850 wrote:
hi,
i tried making "Dimension with Parent-Child Hierarchy" as described in your tutorials.
i finished with the admin tool and database changes and with no errors.
when trying to create a new answer, by only puting the hierarchy column in the answer.
the result show "no result" exist.
i am not sure what i am doing wrong. maybe you can point me to the problem?
thanks
Mirit.Hi Mirit,
What is the table that you created hierarchy on?
Which column in the hierarchy you pulled into your reports to see the No Result message?
Please query the table and see if has data.
Thanks,
G. SK

Similar Messages

  • Dimension with Parent-Child Hierarchy - not working

    hi,
    i tried making "Dimension with Parent-Child Hierarchy" as described in your tutorials.
    i finished with the admin tool and database changes and with no errors.
    when trying to create a new answer, by only puting the hierarchy column in the answer.
    the result show "no result" exist.
    i am not sure what i am doing wrong. maybe you can point me to the problem?
    thanks
    Mirit.

    956850 wrote:
    hi,
    i tried making "Dimension with Parent-Child Hierarchy" as described in your tutorials.
    i finished with the admin tool and database changes and with no errors.
    when trying to create a new answer, by only puting the hierarchy column in the answer.
    the result show "no result" exist.
    i am not sure what i am doing wrong. maybe you can point me to the problem?
    thanks
    Mirit.Hi Mirit,
    What is the table that you created hierarchy on?
    Which column in the hierarchy you pulled into your reports to see the No Result message?
    Please query the table and see if has data.
    Thanks,
    G. SK

  • Parent-child hierarchy - Values not showing

    Hi all,
    I've created an Account Dimension based on the account dimension in Adventure Works Cube.
    What I need to know is how to show account's values when I drag the Account Number to the grid. When I drag the Accounts chart to the grid, all the accounts are shown and their values are shown as well, but when I drag only the Account Number to the grid
    only the leaves' accounts are shown. Any ideas?
    Rafael Fontana

    Hi Rafael,
    According to your description, you created a Parent-child hierarchy using account dimension in Adventure Works Cube, and now you want to query out the members on that dimension, right? If in this case, here is a blog which give out some sample query about
    how to query dimension members, please see:
    Querying dimension members in MDX
    If I have anything misunderstood, please point it out and elaborate your issue, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • OBIEE 11g - Navigation in Parent Child Hiearchy not working

    Hi All,
    I have a employee parent child hierarchy and I want to show revenue for each employee in the report. I have modeled my revenue as a measure like case 4 shown in the following link
    http://www.rittmanmead.com/2010/11/oracle-bi-ee-11g-parent-child-hierarchies-multiple-modeling-methods/
    So for example this is my report ,
    --David (30)
    ---Sandra (15)
    -----Joe (10)
    Joe'e revenue is 10, Sandra's is 5 (showing her 5 Joe's revenue) and David's is 5 (showing his 5 Sandra's revenue)
    Issue :
    Now what I want is to provide action link on the revenue column so that when user would click on revenue for any employee it would direct them to a detail report showing the bifurcation.
    For ex, I want that when user click on 15 which is Sandra's revenue, he would be redirected to a detailed report for Sandra and similary for Joe and David
    MY ISSUE IS that the navigation is NOT working for sandra and Joe. It is only working for David (who is the ancestor of sandra and Joe). When I click on 15 to see sandra's detail report, it doesn't do anything and in the bottom left corner of the browser status bar below I see an ERROR saying
    (same for Joe but David work's fine)
    Message: 'getLevelInfo(...)' is null or not an object
    Line: 1
    Char: 11142
    Code: 0
    URI: http://localhost:7001/analytics/res/b_mozilla/answers/selectionsmodel.js
    Why is that happening? Is that because I have modeled the revenue as an measure and not attribute. Is navigation not possible in this case?
    Anybody has any solution or workaround for this, it will be highly appreciated.
    Thanks,
    Ronny

    Ok, so let me explain this in detail and give the structure of my tables and the data,
    There are three tables.
    1.Parent Child relationship table - pctable
    2.Closure table which OBIEE creates through a script - reltable
    3.Fact table which contains the revenue - facttable
    This is the data
    pctable
    personid | managerid
    David | NULL
    Sandra| David
    Joe|Sandra
    reltable
    memberkey | ancestorkey |distance |is_leaf
    David|NULL|NULL|0
    David|David|0|0
    Sandra|Sandra|0|0
    Joe|Joe|0|0
    Sandra|David|1|0
    Joe|Sandra|1|1
    Joe|David|2|1
    facttable
    personid|revenue
    David|5
    Sandra|5
    Joe|10
    and my joins conditions are, I join pctable to reltable and then reltable is joined to facttable like this.
    pctable.personid = reltable.ancestorkey
    reltable.memberkey = facttable.personid
    and then in the report, when I pull up the pchierarchy build from pctable and revenue , I get as below and like I said, when I click on Sandra to see the revenue she contributes, I am not able to navigate. Can you let me know what modifications needs to be done?
    ---David(20)
    ----Sandra(15)
    ------Joe(10)

  • Parent-Child Hierarchy Show No Data

    Hi:
    OBIEE 11.1.1.6.5
    I created a parent-child hierarchy following multiple examples in books and on the web. I can pull the presentation hierarchy--by itself--into a view and drill up and down. But when I add a measurement from the fact table, I receive a no data found error. I copied the SQL into SQL*Developer and ran it, and it too returned no data. I've tried to read and debug the query in SQL*Developer, but I don't understand what it is doing.
    The dimension table I am using for the parent-child hierarchy has a cost_Center_id and parent_cost_center_id. I used the Parent-Child dimension wizard to create and populate the new hierarchy table.
    I can create a view by using the cost_center item and a fact table measurement without the presentation hierarchy, so it has something to do with the presentation hierarchy.
    I've been at this for a few days now, and I've run out of ideas. Can anyone suggest what I may have done wrong?
    Thanks.

    check if there is data in the fact table.. Next check also if the join condition between the dimension and fact is valid.

  • No data for Parent-child hierarchy column in Pivot table view

    Hi all,
    I used OBIEE 11.1.1.6.2 Version.
    I drag one Parent-child hierarchy column and one measure and show result with a pivot table view.
    But when I click "+" icon to show detail level data,
    It messaged that: "*the layout of this view combined with the data,selections,drills,or prompt values chosen resulted in no data*."
    But it can show every-level data when I used table view.
    It was so strange..
    Did anybody meet this before?
    Thanks in advance.
    regards,
    Anne

    Hi,
    Yes, I have the same problem with pivot table for hierarchy dimension.
    If you use a normal table (not pivot) it seem to work. Unfortunatley with restrictions as normal table view have.
    Same problem still exist in 11.1.1.6.5
    I have logged a SR to Oracle about this.

  • Parent Child Hierarchy Issue in OBIEE 11g

    Hi All,
    I am in OBIEE 11G v6. I have a sales fact table where the grain is one sale. So I have one row for every sale done.
    Now I have a ragged employee hierarchy like this with David at the root node.
    David >>Richard>>Sean
    David >>James
    Also, I have a role dimension which gives me what role each employee has performed on a sale. Only one employee can be associated with one sale. This is the way Roles have been asssigned
    David = Manager
    Richard = Off1
    Sean = Off2
    James = Off2
    Both Sean and James can have same Roles. Now I have created a parent child hierarchy for my employee dimension and the closure table. Defined the member key, ancestor key relationship in the parent child setting etc.
    Now in the report when I pull the parent child hierarchy and the sales_amount in the report, it comes out perfect with all the ragged hierarchy resolved. But the issue comes when I try to limit the report on Role = Off2. It gives me an error saying " The layout of this view combined with the data, selection , drills resulted in no data. Undo drill and view prompt values". Basically what i want is to be able to select any role type and then my hierarchy should be adjusted to show me that data. Like when I select Off2, I want to see David at the Top level and Sean and James under him because they are both Off 2 and David is their manager.
    Is that possbile? Also, am I getting this error because when I select Off2 though it gets Sean and James but since David is not Off2, I don't get the data?
    I hope I was able to explain the issue, any help on this would be greatly appreciated.
    Thanks
    Ronny

    So basically this means that if I build a parent child hierarchy on table A having the stucture like
    --David (Manager)
    -----James (Off1)
    --------Bill (Off2)
    and in my sales fact table for let's say today, I have only rows for Bill (Off2) because he is the only officer who did the sales today. Now when I will join my fact table to parent child hierarchy table A I will NOT get any data ? because there is no James who is the parent of Bill. So obiee need to have parent pulled off in the data (ANCESTOR) to be able to roll up the child.(IS_LEAF = 1)
    I testes this and if my data only contains only rows for Bill (or I limit on ROLE = Off2) then it won't show the hierarchy. The query which OBIEE fires is to look for either ANCESTOR_KEY = NULL OR (DISTANCE = 1 AND ANCESTOR KEY IN (Bill). Therefore it doesn't I am wondering then what is the use of builiding the parent child hierarchy when we need to pull in all the ancestors (like in this case James for bill and David for james) because in real scenarios there can be cases wherein we would want to filter the data based on other dimensions to which the parent child hierarchy joins ?

  • How to update a parent child hierarchy in OBIEE

    Hello All
    Quick question about updating parent child hierarchy in OBIEE.
    As we know, OBIEE 11G allows us to create value based hierarchy by generating table creation script and insert script. In the typical example of employee dimension, the parent child relationship table will be created with the following 4 attributes:
    MEMBER_KEY, ANCESTOR_KEY, DISTANCE, IS_LEAF
    So, what if later in the years some of the employees got promoted, retired or transferred? The value based hierarchy is going to change because person 1 reports to manager 2 now instead of 1. Obviously, the records in employee dimension is going to be updated. When that happens, how to update the parent child relation table with the same information? Do we have to rerun the insert script? How do we keep the history of employee changes and hierarchy changes?
    Please advice
    Thank you

    I guess it will update when the structure changes,Let see the response from other gurus.
    Thanks,

  • Sub Total value is empty in  parent child hierarchy pivot table

    Hi All,
    I am using obiee 11.1.1.6.2 in Test environment. Is it a known issue/bug for 11.1.1.6.2 to show empty/blank values for sub total when using parent child hierarchy pivot table. The sub total for parent value is showing but sub total for child value is coming blank. However, in 11.1.1.5.0, we do not have any issue with this.
    Is it a known bug in obiee 11.1.1.6.2?
    Thanks,
    Sushil

    Yes it is a known bug...
    Thanks.

  • Dynamic hierarchy in parent child hierarchy table??

    Do you have any experience to handle the requirement of dynamic hierarchy in universe/webi?
    We have some data in parent child hierarchy as below u201CCustomeru201D table.
    Customer
    Parent          Child
    Z                  A
    Z                  B
    A                  AA
    B                  BB
    AA               AAA
    For example, Company Z is the parent company of Company A.
    Another table, Amount is the amount value of different Customers.
    Amount
    ID               Amt
    AA               10
    AAA            1
    BB                2
    Is there any functionality in Universe designer to build related Classes and objects, So that the web intelligence documents represent the following report with the drilling results?
    When we want to see the ID and Amt, the expected result should be:
    Z                13
    when we drill down Z
    the result should be:
    A                11
    B                2
    when we drill down A:
    the result should be:
    AA              11
    notes **
    the level of hierarchy is dynamic
    Any suggestion is appreciated.  Thanks.

    Hi,
    The only way to do it is to create recursive derived table that flatten you parent child hierarchy with a given maximum depth.
    Here is a sample I built a long time ago to flatten a parent-child hierarchy on Employees table in Foodmart database (SQL Server).
    Didier
    SELECT DISTINCT
         Z.employee_id,
         A.supervisor_id_1,
         A.employee_id_1,
         A.full_name_1,
         A.supervisor_id_2,
         A.employee_id_2,
         A.full_name_2,
         A.supervisor_id_3,
         A.employee_id_3,
         A.full_name_3,
         A.supervisor_id_4,
         A.employee_id_4,
         A.full_name_4,
         A.supervisor_id_5,
         A.employee_id_5,
         A.full_name_5,
         A.supervisor_id_6,
         A.employee_id_6,
         A.full_name_6,
         Z.supervisor_id AS supervisor_id_7,
         Z.employee_id AS employee_id_7,
         Z.full_name AS full_name_7
    FROM employee Z,
         SELECT DISTINCT
              A.supervisor_id_1,
              A.employee_id_1,
              A.full_name_1,
              A.supervisor_id_2,
              A.employee_id_2,
              A.full_name_2,
              A.supervisor_id_3,
              A.employee_id_3,
              A.full_name_3,
              A.supervisor_id_4,
              A.employee_id_4,
              A.full_name_4,
              A.supervisor_id_5,
              A.employee_id_5,
              A.full_name_5,
              Z.supervisor_id AS supervisor_id_6,
              Z.employee_id AS employee_id_6,
              Z.full_name AS full_name_6
         FROM employee Z,
              SELECT DISTINCT
                   A.supervisor_id_1,
                   A.employee_id_1,
                   A.full_name_1,
                   A.supervisor_id_2,
                   A.employee_id_2,
                   A.full_name_2,
                   A.supervisor_id_3,
                   A.employee_id_3,
                   A.full_name_3,
                   A.supervisor_id_4,
                   A.employee_id_4,
                   A.full_name_4,
                   Z.supervisor_id AS supervisor_id_5,
                   Z.employee_id AS employee_id_5,
                   Z.full_name AS full_name_5
              FROM employee Z,
                   SELECT DISTINCT
                        A.supervisor_id_1,
                        A.employee_id_1,
                        A.full_name_1,
                        A.supervisor_id_2,
                        A.employee_id_2,
                        A.full_name_2,
                        A.supervisor_id_3,
                        A.employee_id_3,
                        A.full_name_3,
                        Z.supervisor_id AS supervisor_id_4,
                        Z.employee_id AS employee_id_4,
                        Z.full_name AS full_name_4
                   FROM employee Z,
                        SELECT DISTINCT
                             A.supervisor_id_1,
                             A.employee_id_1,
                             A.full_name_1,
                             A.supervisor_id_2,
                             A.employee_id_2,
                             A.full_name_2,
                             Z.supervisor_id AS supervisor_id_3,
                             Z.employee_id AS employee_id_3,
                             Z.full_name AS full_name_3
                        FROM employee Z,
                             SELECT DISTINCT
                                  A.supervisor_id_1,
                                  A.employee_id_1,
                                  A.full_name_1,
                                  Z.supervisor_id AS supervisor_id_2,
                                  Z.employee_id AS employee_id_2,
                                  Z.full_name AS full_name_2
                             FROM employee Z,
                                  SELECT DISTINCT
                                       supervisor_id AS supervisor_id_1,
                                       employee_id AS employee_id_1,
                                       full_name AS full_name_1
                                   FROM employee
                                   WHERE supervisor_id = 0 OR supervisor_id IS NULL
                             ) A
                             WHERE A.employee_id_1 = Z.supervisor_id
                        ) A
                        WHERE A.employee_id_2 = Z.supervisor_id
                   ) A
                   WHERE A.employee_id_3 = Z.supervisor_id
              ) A
              WHERE A.employee_id_4 = Z.supervisor_id
         ) A
         WHERE A.employee_id_5 = Z.supervisor_id
    ) A
    WHERE A.employee_id_6 = Z.supervisor_id
    UNION
    SELECT DISTINCT
         A.employee_id_6 AS employee_id,
         A.supervisor_id_1,
         A.employee_id_1,
         A.full_name_1,
         A.supervisor_id_2,
         A.employee_id_2,
         A.full_name_2,
         A.supervisor_id_3,
         A.employee_id_3,
         A.full_name_3,
         A.supervisor_id_4,
         A.employee_id_4,
         A.full_name_4,
         A.supervisor_id_5,
         A.employee_id_5,
         A.full_name_5,
         A.supervisor_id_6,
         A.employee_id_6,
         A.full_name_6,
         NULL AS supervisor_id_7,
         NULL AS employee_id_7,
         NULL AS full_name_7
    FROM employee Z,
         SELECT DISTINCT
              A.supervisor_id_1,
              A.employee_id_1,
              A.full_name_1,
              A.supervisor_id_2,
              A.employee_id_2,
              A.full_name_2,
              A.supervisor_id_3,
              A.employee_id_3,
              A.full_name_3,
              A.supervisor_id_4,
              A.employee_id_4,
              A.full_name_4,
              A.supervisor_id_5,
              A.employee_id_5,
              A.full_name_5,
              Z.supervisor_id AS supervisor_id_6,
              Z.employee_id AS employee_id_6,
              Z.full_name AS full_name_6
         FROM employee Z,
              SELECT DISTINCT
                   A.supervisor_id_1,
                   A.employee_id_1,
                   A.full_name_1,
                   A.supervisor_id_2,
                   A.employee_id_2,
                   A.full_name_2,
                   A.supervisor_id_3,
                   A.employee_id_3,
                   A.full_name_3,
                   A.supervisor_id_4,
                   A.employee_id_4,
                   A.full_name_4,
                   Z.supervisor_id AS supervisor_id_5,
                   Z.employee_id AS employee_id_5,
                   Z.full_name AS full_name_5
              FROM employee Z,
                   SELECT DISTINCT
                        A.supervisor_id_1,
                        A.employee_id_1,
                        A.full_name_1,
                        A.supervisor_id_2,
                        A.employee_id_2,
                        A.full_name_2,
                        A.supervisor_id_3,
                        A.employee_id_3,
                        A.full_name_3,
                        Z.supervisor_id AS supervisor_id_4,
                        Z.employee_id AS employee_id_4,
                        Z.full_name AS full_name_4
                   FROM employee Z,
                        SELECT DISTINCT
                             A.supervisor_id_1,
                             A.employee_id_1,
                             A.full_name_1,
                             A.supervisor_id_2,
                             A.employee_id_2,
                             A.full_name_2,
                             Z.supervisor_id AS supervisor_id_3,
                             Z.employee_id AS employee_id_3,
                             Z.full_name AS full_name_3
                        FROM employee Z,
                             SELECT DISTINCT
                                  A.supervisor_id_1,
                                  A.employee_id_1,
                                  A.full_name_1,
                                  Z.supervisor_id AS supervisor_id_2,
                                  Z.employee_id AS employee_id_2,
                                  Z.full_name AS full_name_2
                             FROM employee Z,
                                  SELECT DISTINCT
                                       supervisor_id AS supervisor_id_1,
                                       employee_id AS employee_id_1,
                                       full_name AS full_name_1
                                   FROM employee
                                   WHERE supervisor_id = 0 OR supervisor_id IS NULL
                             ) A
                             WHERE A.employee_id_1 = Z.supervisor_id
                        ) A
                        WHERE A.employee_id_2 = Z.supervisor_id
                   ) A
                   WHERE A.employee_id_3 = Z.supervisor_id
              ) A
              WHERE A.employee_id_4 = Z.supervisor_id
         ) A
         WHERE A.employee_id_5 = Z.supervisor_id
    ) A
    UNION
    SELECT DISTINCT
         A.employee_id_5 AS employee_id,
         A.supervisor_id_1,
         A.employee_id_1,
         A.full_name_1,
         A.supervisor_id_2,
         A.employee_id_2,
         A.full_name_2,
         A.supervisor_id_3,
         A.employee_id_3,
         A.full_name_3,
         A.supervisor_id_4,
         A.employee_id_4,
         A.full_name_4,
         A.supervisor_id_5,
         A.employee_id_5,
         A.full_name_5,
         NULL AS supervisor_id_6,
         NULL AS employee_id_6,
         NULL AS full_name_6,
         NULL AS supervisor_id_7,
         NULL AS employee_id_7,
         NULL AS full_name_7
    FROM employee Z,
         SELECT DISTINCT
              A.supervisor_id_1,
              A.employee_id_1,
              A.full_name_1,
              A.supervisor_id_2,
              A.employee_id_2,
              A.full_name_2,
              A.supervisor_id_3,
              A.employee_id_3,
              A.full_name_3,
              A.supervisor_id_4,
              A.employee_id_4,
              A.full_name_4,
              Z.supervisor_id AS supervisor_id_5,
              Z.employee_id AS employee_id_5,
              Z.full_name AS full_name_5
         FROM employee Z,
              SELECT DISTINCT
                   A.supervisor_id_1,
                   A.employee_id_1,
                   A.full_name_1,
                   A.supervisor_id_2,
                   A.employee_id_2,
                   A.full_name_2,
                   A.supervisor_id_3,
                   A.employee_id_3,
                   A.full_name_3,
                   Z.supervisor_id AS supervisor_id_4,
                   Z.employee_id AS employee_id_4,
                   Z.full_name AS full_name_4
              FROM employee Z,
                   SELECT DISTINCT
                        A.supervisor_id_1,
                        A.employee_id_1,
                        A.full_name_1,
                        A.supervisor_id_2,
                        A.employee_id_2,
                        A.full_name_2,
                        Z.supervisor_id AS supervisor_id_3,
                        Z.employee_id AS employee_id_3,
                        Z.full_name AS full_name_3
                   FROM employee Z,
                        SELECT DISTINCT
                             A.supervisor_id_1,
                             A.employee_id_1,
                             A.full_name_1,
                             Z.supervisor_id AS supervisor_id_2,
                             Z.employee_id AS employee_id_2,
                             Z.full_name AS full_name_2
                        FROM employee Z,
                             SELECT DISTINCT
                                  supervisor_id AS supervisor_id_1,
                                  employee_id AS employee_id_1,
                                  full_name AS full_name_1
                              FROM employee
                              WHERE supervisor_id = 0 OR supervisor_id IS NULL
                        ) A
                        WHERE A.employee_id_1 = Z.supervisor_id
                   ) A
                   WHERE A.employee_id_2 = Z.supervisor_id
              ) A
              WHERE A.employee_id_3 = Z.supervisor_id
         ) A
         WHERE A.employee_id_4 = Z.supervisor_id
    ) A
    UNION
    SELECT DISTINCT
         A.employee_id_4 AS employee_id,
         A.supervisor_id_1,
         A.employee_id_1,
         A.full_name_1,
         A.supervisor_id_2,
         A.employee_id_2,
         A.full_name_2,
         A.supervisor_id_3,
         A.employee_id_3,
         A.full_name_3,
         A.supervisor_id_4,
         A.employee_id_4,
         A.full_name_4,
         NULL AS supervisor_id_5,
         NULL AS employee_id_5,
         NULL AS full_name_5,
         NULL AS supervisor_id_6,
         NULL AS employee_id_6,
         NULL AS full_name_6,
         NULL AS supervisor_id_7,
         NULL AS employee_id_7,
         NULL AS full_name_7
    FROM employee Z,
         SELECT DISTINCT
              A.supervisor_id_1,
              A.employee_id_1,
              A.full_name_1,
              A.supervisor_id_2,
              A.employee_id_2,
              A.full_name_2,
              A.supervisor_id_3,
              A.employee_id_3,
              A.full_name_3,
              Z.supervisor_id AS supervisor_id_4,
              Z.employee_id AS employee_id_4,
              Z.full_name AS full_name_4
         FROM employee Z,
              SELECT DISTINCT
                   A.supervisor_id_1,
                   A.employee_id_1,
                   A.full_name_1,
                   A.supervisor_id_2,
                   A.employee_id_2,
                   A.full_name_2,
                   Z.supervisor_id AS supervisor_id_3,
                   Z.employee_id AS employee_id_3,
                   Z.full_name AS full_name_3
              FROM employee Z,
                   SELECT DISTINCT
                        A.supervisor_id_1,
                        A.employee_id_1,
                        A.full_name_1,
                        Z.supervisor_id AS supervisor_id_2,
                        Z.employee_id AS employee_id_2,
                        Z.full_name AS full_name_2
                   FROM employee Z,
                        SELECT DISTINCT
                             supervisor_id AS supervisor_id_1,
                             employee_id AS employee_id_1,
                             full_name AS full_name_1
                         FROM employee
                         WHERE supervisor_id = 0 OR supervisor_id IS NULL
                   ) A
                   WHERE A.employee_id_1 = Z.supervisor_id
              ) A
              WHERE A.employee_id_2 = Z.supervisor_id
         ) A
         WHERE A.employee_id_3 = Z.supervisor_id
    ) A
    UNION
    SELECT DISTINCT
         A.employee_id_3 AS employee_id,
         A.supervisor_id_1,
         A.employee_id_1,
         A.full_name_1,
         A.supervisor_id_2,
         A.employee_id_2,
         A.full_name_2,
         A.supervisor_id_3,
         A.employee_id_3,
         A.full_name_3,
         NULL AS supervisor_id_4,
         NULL AS employee_id_4,
         NULL AS full_name_4,
         NULL AS supervisor_id_5,
         NULL AS employee_id_5,
         NULL AS full_name_5,
         NULL AS supervisor_id_6,
         NULL AS employee_id_6,
         NULL AS full_name_6,
         NULL AS supervisor_id_7,
         NULL AS employee_id_7,
         NULL AS full_name_7
    FROM employee Z,
         SELECT DISTINCT
              A.supervisor_id_1,
              A.employee_id_1,
              A.full_name_1,
              A.supervisor_id_2,
              A.employee_id_2,
              A.full_name_2,
              Z.supervisor_id AS supervisor_id_3,
              Z.employee_id AS employee_id_3,
              Z.full_name AS full_name_3
         FROM employee Z,
              SELECT DISTINCT
                   A.supervisor_id_1,
                   A.employee_id_1,
                   A.full_name_1,
                   Z.supervisor_id AS supervisor_id_2,
                   Z.employee_id AS employee_id_2,
                   Z.full_name AS full_name_2
              FROM employee Z,
                   SELECT DISTINCT
                        supervisor_id AS supervisor_id_1,
                        employee_id AS employee_id_1,
                        full_name AS full_name_1
                    FROM employee
                    WHERE supervisor_id = 0 OR supervisor_id IS NULL
              ) A
              WHERE A.employee_id_1 = Z.supervisor_id
         ) A
         WHERE A.employee_id_2 = Z.supervisor_id
    ) A
    UNION
    SELECT DISTINCT
         A.employee_id_2 AS employee_id,
         A.supervisor_id_1,
         A.employee_id_1,
         A.full_name_1,
         A.supervisor_id_2,
         A.employee_id_2,
         A.full_name_2,
         NULL AS supervisor_id_3,
         NULL AS employee_id_3,
         NULL AS full_name_3,
         NULL AS supervisor_id_4,
         NULL AS employee_id_4,
         NULL AS full_name_4,
         NULL AS supervisor_id_5,
         NULL AS employee_id_5,
         NULL AS full_name_5,
         NULL AS supervisor_id_6,
         NULL AS employee_id_6,
         NULL AS full_name_6,
         NULL AS supervisor_id_7,
         NULL AS employee_id_7,
         NULL AS full_name_7
    FROM employee Z,
         SELECT DISTINCT
              A.supervisor_id_1,
              A.employee_id_1,
              A.full_name_1,
              Z.supervisor_id AS supervisor_id_2,
              Z.employee_id AS employee_id_2,
              Z.full_name AS full_name_2
         FROM employee Z,
              SELECT DISTINCT
                   supervisor_id AS supervisor_id_1,
                   employee_id AS employee_id_1,
                   full_name AS full_name_1
               FROM employee
               WHERE supervisor_id = 0 OR supervisor_id IS NULL
         ) A
         WHERE A.employee_id_1 = Z.supervisor_id
    ) A
    UNION
    SELECT DISTINCT
         A.employee_id_1 AS employee_id,
         A.supervisor_id_1,
         A.employee_id_1,
         A.full_name_1,
         NULL AS supervisor_id_2,
         NULL AS employee_id_2,
         NULL AS full_name_2,
         NULL AS supervisor_id_3,
         NULL AS employee_id_3,
         NULL AS full_name_3,
         NULL AS supervisor_id_4,
         NULL AS employee_id_4,
         NULL AS full_name_4,
         NULL AS supervisor_id_5,
         NULL AS employee_id_5,
         NULL AS full_name_5,
         NULL AS supervisor_id_6,
         NULL AS employee_id_6,
         NULL AS full_name_6,
         NULL AS supervisor_id_7,
         NULL AS employee_id_7,
         NULL AS full_name_7
    FROM employee Z,
         SELECT DISTINCT
              supervisor_id AS supervisor_id_1,
              employee_id AS employee_id_1,
              full_name AS full_name_1
          FROM employee
          WHERE supervisor_id = 0 OR supervisor_id IS NULL
    ) A

  • Parent Child Hierarchy for Type 2

    I have read the articles on Parent Child hierarchy setup in OBIEE 11g, however, most are based on what seems to be a current snapshot of the Employee-Manager relationship. Has anyone tried to build out a Parent-Child hierarchy/table off a Type 2 dimension. Being able to navigate what the hierarchy may have been on a specific date.
    I would welcome any feedback, thanks.

    Hi,
    Thanks for the reply, I'm actually using snapshots. But even with the Type 2 Dim I don't think it will work.
    When OBIEE generates the very first sql against the Parent-Child table the fact table is not included in the query. It seems to create 2 queries - one to find the top level parent (ancestor key is null) and then one to find all the leaf nodes.
    It does not have any join to the fact table when it does this. So if you have multiple rows in the table (with date stamps) for a single row (person in this case) - it picks up both rows. Therefore, when you have a person who was, say, promoted to manager, and WAS a leaf node, and is now a manager, they show up in the leaf query and don't display in the hierarchy as a manager.
    Once it has the leaf nodes and it joins to the fact table everything works (ie the surrogate key join).
    I'm trying to figure out if there is any way to influence those initial queries against the parent-child table.
    Hopefully that made sense.
    Thanks,
    Tori

  • Parent-Child hierarchy based on two-column key

    Hello
    Is it possible to create a parent-child hierarchy, if the primary key of the table consists of two columns?
    My table looks like:
    TRACE_ID | DIAG_ID | SUPER_DIAG_ID
    with TRACE_ID and DIAG_ID as PK.
    If I define only DIAG_ID as PK, I can add a logical dimension (PC-hierarchy) without problems.
    However when I also add TRACE_ID to my PK, I cannot select a member key in the new logical dimension window and therefore not create a logical dimension.
    Is this a limitation of OBIEE and I have to merge the two colums (which would be rather bad, as there are FK relations to DIAG_ID) or is there a solution?
    Regards
    Matthias

    Dear Gowtham  ,
    I am very well aware of the level based hierarchy available in BO .
    The issue that i have raised is all about the Parent Child Hierarchy which creates the recursive query.
    I.e Every Parent has a child and that child can be parent of some other . (See the original example for more illustration)

  • Parent Child Hierarchy

    I am new learner for using OBIEE 11g, when I try to create the Parent_Child_Hierarchy in the repository, BI answer in the web shows the errors:
    "State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 38107] *Not all four columns are defined for closure table 'Parent_Chile_Table_Closure'*. (HY000)".
    According to the help web "http://www.adivaconsulting.com/adiva-blog/item/22-obiee-11g-hierarchical-table.html", I have created the relational Parent-Child-Hierarchy table in the database that is imported into the physical layer, and finish every steps, but when I drag the hierarchy in the presentation layer into display scope, which shows the errors mentioned above.
    If you known the method for solving it,please help me and share your idea, thanks!

    Hey,
    I am also facing the same issue when i try to replicate this practice. (Create Logical Dimensions with Parent Child Hierarchies -- http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11115/biadmin11g_02/biadmin11g.htm#t9s3)
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 22056] To use hierarchical functions, you need to associate a Closure Table with Logical Table Source 'LTS1 Sales Rep'. (HY000)
    SQL Issued: SET VARIABLE PREFERRED_CURRENCY='USD';SELECT 0 s_0, "Y - Sample Sales"."Sales Reps"."Sales Rep Name" s_1, CASE WHEN ISLEAF("Y - Sample Sales"."Sales Reps"."H5 Sales Rep DimHier") THEN 1 ELSE 0 END s_2, IDOF("Y - Sample Sales"."Sales Reps"."H5 Sales Rep DimHier") s_3, PARENT("Y - Sample Sales"."Sales Reps"."H5 Sales Rep DimHier") s_4 FROM "Y - Sample Sales" WHERE ISROOT("Y - Sample Sales"."Sales Reps"."H5 Sales Rep DimHier")

  • OBIEE 11g Parent Child hierarchy

    Hi,
    I'm trying to setup a parent-child hierarchy dimension. I have setup a new hierarchy dimension using numeric keys but want to display another field in the hierarchical column on a report e.g. employee fullname & not the member_key based on a numeric value. Can this be done & how do you do it? All the examples I have seen use varchar2 type columns as the keys to do this.
    Thanks in advance, Phil
    My Setup
    =============
    Dimension - logical level
    ===============
    member key = employee_id
    parent-child table source
    ===============
    member key = employee_id
    parent key = supervisor_id
    relationship distance = levels_removed
    leaf node identifier = isleaf
    Employee logical folder
    ==============
    employee_id ( number)- primary key
    full_name (varchar2) - unique key
    supervisor_id ( number)
    Closure table
    =========
    employee_id ( number)
    supervisor_id ( number)
    level ( number)
    isleaf ( number)

    Thanks for the link Suresh but the aggregations are working correctly.
    My problem is only at the display level. I need to create a dashboard that displays the complete hierarchy.
    So for example if I have this hierarchy:
    - Steven King
    - Adam Frip
    Alexis Bull
    Anthony Cabrio
    Alberto Erraruriz
    Den Raphaely
    I want the dashboard to display immediately that complete hierarchy. If someone adds a member to the hierarchy in the database, the dashboard should display this new member without having to manually modify the dashboard.
    - Steven King
    - Adam Frip
    Alexis Bull
    Anthony Cabrio
    - Alberto Erraruriz
    Mozhe Atkinson
    Den Raphaely
    Also, if I just manually open the hierarchy and save the dashboard, if "Steven King" is replaced by "Shanta Vollman", the dashboard doesn't like it and returns a result looking like:
    - Adam Frip
    Alexis Bull
    Anthony Cabrio
    - Alberto Erraruriz
    Mozhe Atkinson
    Den Raphaely
    + Shanta Vollman
    So I'm looking for some option that will tell OBIEE to open the hierarchy without having to specify "Drill down on member "Steven King"", "Drill down on member "Adam Frip"...
    I hope I'm explaining correctly...

  • No Results after build a Parent-Child Hierarchy in OBIEE11G

    Hi All:
    Here's an problem. I followed the "http://sandybi.wordpress.com/2010/08/17/hierarchies-in-obiee-11g-part-1/" this article step by step to create a parent-child hierarchy in admin tool in OBIEE11G.
    But after check in and try to retrieve the hierarchy data in Answer. There's always displays "No Results."
    Is there any suggestions for this ? Really urgent and thanks for your help.
    Best regards
    Sunny

    @Aketi
    It is One way that We derive
    "sys_connect_by_path(RowIDToChar(RowID),'.') as
    RowIDList"
    Then
    We use Left Join Using
    "instr(RowIDList,RowIDToChar(RowID))".sorry, didn't catch what you mean.
    my site :-)
    http://oraclesqlpuzzle.hp.infoseek.co.jp/4-13.html
    pity, I don't know Japanese :(
    @Rob
    your query is good and simple :) probably it's the best alternative for the OP.
    But it won't work with not a plain hierarchy, e.g.:
          1
        2   3
          4
        5   6
    SQL> create table hierarchy (child,parent)
      2     as
      3     select 1, null from dual union all
      4     select 2, 1 from dual union all
      5     select 3, 1 from dual union all
      6     select 4, 3 from dual union all
      7     select 4, 2 from dual union all
      8     select 5, 4 from dual union all
      9     select 6, 4 from dual
    10  /
    Table created
    SQL>
    SQL> create table data (hierarchyid,value)
      2    as
      3    select 5, 10 from dual union all
      4    select 6, 25 from dual
      5  /
    Table created
    SQL>
    SQL> select h.child
      2           , sum(connect_by_root d.value)
      3        from hierarchy h
      4           , data d
      5       where h.child = d.hierarchyid (+)
      6     connect by prior h.parent = h.child
      7       group by h.child
      8       order by h.child
      9  /
         CHILD SUM(CONNECT_BY_ROOTD.VALUE)
             1                          70
             2                          35
             3                          35
             4                          70
             5                          10
             6                          25
    6 rows selected
    SQL>

Maybe you are looking for

  • CPS parameters are not getting updated in SAP

    We have recently migrated our SAP and CPs servers, after that we are  facing few CPS issues  and it is affecting lot of key batch jobs. One typical example is given below. CPS is supposed to trigger a job  DD simulation, by copying the SOURCE_DATE_ID

  • How to create a process type/variant for this in Process Chain

    i I created a Selective Delete Variant (Delete_Facts) with some data selection upon which data to be deleted, to be used in Process chain. My requirment is I need to include that in the process chain in a such a way that that variant should be execut

  • How do I best implement a comparable parameterized class?

    I am trying to implement a parameterized Wrapper class that I want to make Comparable, and the ordering is supposed to be consistent with equals(). How can this be done? I'm kind of lost ... My first approach looked like this: class Wrapper<T> implem

  • Export SWF to have all animation in main timeline?

    I have an animated logo (LOGO.SWF) and I have many instances of the same symbol that play outside the main timeline. I would like to export this SWF (LOGO.SWF) so that I can import it into another FLA (BANNERAD.FLA). But when I import it now into (BA

  • Agent is Ready by don´t apper queue by Supervisor

    Hi Guys, My Customer have the solution UCCX 8.0.2. The Agent is working normally (Ready), but, for Supervisor the all Agent is appearing with not ready. Any Idea about  This. The Supervisor did restart the software, but, the problem continue. Thanks,