Managing Hierarchical tables

Hi all,
I need a query to get the emp hirarchical table as follows: (BASED ON EMP TABLE)
KING --> JONES --> SCOTT
KING --> JONES --> FORD
and so on...
In other words, all the path from the president to the last level of the organization in one line each. For example:
King is manager of Jones, and Jones is chief of Scott and Ford, so I want to display both paths.
Moreover, I don't want to filter anything, I want to show all the possible paths for all the employees.
I would appreciate your help.
Thanks.

In Oracle 8i, you can do the same thing, using the following packaged function by Solomon Yakobson:
CREATE OR REPLACE
PACKAGE Hierarchy
  IS
        TYPE BranchTableType IS TABLE OF VARCHAR2(4000)
          INDEX BY BINARY_INTEGER;
        BranchTable BranchTableType;
        FUNCTION Branch(vLevel          IN NUMBER,
                        vValue          IN VARCHAR2,
                        vDelimiter      IN VARCHAR2 DEFAULT CHR(0))
                        RETURN VARCHAR2;
        PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
END Hierarchy;
Package created.
CREATE OR REPLACE
PACKAGE BODY Hierarchy
  IS
        ReturnValue VARCHAR2(4000);
  FUNCTION Branch(vLevel        IN NUMBER,
                  vValue        IN VARCHAR2,
                  vDelimiter    IN VARCHAR2 DEFAULT CHR(0))
                  RETURN VARCHAR2
   IS
   BEGIN
        BranchTable(vLevel) := vValue;
        ReturnValue := vValue;
        FOR I IN REVERSE 1..vLevel - 1 LOOP
          ReturnValue := BranchTable(I)|| vDelimiter || ReturnValue;
        END LOOP;
        RETURN ReturnValue;
  END Branch;
END Hierarchy;
Package body created.
COLUMN   name FORMAT A10
COLUMN   val  FORMAT A35
SELECT   name, empno, mgr, val
FROM     (SELECT     LPAD (' ', ( level - 1 )) || ename name, empno, mgr,
                     hierarchy.branch (LEVEL, ename, ' --> ') AS val
          FROM       emp
          START WITH mgr IS NULL
          CONNECT BY PRIOR empno = mgr)
ORDER BY 4
NAME            EMPNO        MGR VAL                                                               
KING             7839            KING                                                              
BLAKE           7698       7839 KING --> BLAKE                                                    
  ALLEN          7499       7698 KING --> BLAKE --> ALLEN                                          
  JAMES          7900       7698 KING --> BLAKE --> JAMES                                          
  MARTIN         7654       7698 KING --> BLAKE --> MARTIN                                         
  TURNER         7844       7698 KING --> BLAKE --> TURNER                                         
  WARD           7521       7698 KING --> BLAKE --> WARD                                           
CLARK           7782       7839 KING --> CLARK                                                    
  MILLER         7934       7782 KING --> CLARK --> MILLER                                         
JONES           7566       7839 KING --> JONES                                                    
  FORD           7902       7566 KING --> JONES --> FORD                                           
   SMITH         7369       7902 KING --> JONES --> FORD --> SMITH                                 
  SCOTT          7788       7566 KING --> JONES --> SCOTT                                          
   ADAMS         7876       7788 KING --> JONES --> SCOTT --> ADAMS                                
14 rows selected.

Similar Messages

  • How to query 2 hierarchical tables and join?

    Hi
    I've been bashing my head against a well to get this to work efficiently in 10g. I can solve the following writing some pretty horrible SQL, but can't figure out how to do it elegantly and optimally.
    We have two hierarchical tables as follows:
    select * from data_categories dac
    dac_code name parent_dac_code
    10 MANAGEMENT
    20 MEDICATION 10
    30 PROCEDURE 10
    40 SURVEY
    50 ASSESS
    60 NATURE 50
    70 OBSERVE 60
    select * from data_elements des
    des_id name parent_des_id dac_code display_seq
    100 DOSE MEDICATION 1
    110 1MG 100 1
    120 2MG 100 2
    130 3MG 100 3
    140 ROUTE MEDICATION 2
    150 ET 140 1
    160 EM 140 2
    170 RESPONSE MEDICATION 3
    180 IMPROVED 170 1
    190 NOCHANGE 170 2
    200 FILED MANAGEMENT 1
    210 INPUT OBSERVE 1
    You'll note:
    1) We have hierarchies in both tables, and a fk from data_elements to data_categories via the dac_code.
    2) The depth of both data_categories and data_elements is unlimited.
    3) There is no single root node record in either table.
    4) The appropriate PK and FK indexes exist.
    We need to write a query that returns the following results:
    root_dac_code parent_dac_code des_level des_id name display_seq
    ASSESS OBSERVE 1 210 INPUT 1
    MANAGEMENT MEDICATION 1 100 DOSE 1
    MANAGEMENT MEDICATION 2 110 1MG 1
    MANAGEMENT MEDICATION 2 120 2MG 2
    MANAGEMENT MEDICATION 2 130 3MG 3
    MANAGEMENT MEDICATION 1 140 ROUTE 1
    MANAGEMENT MEDICATION 2 150 ET 1
    MANAGEMENT MEDICATION 2 160 EM 2
    MANAGEMENT MEDICATION 1 170 RESPONSE 3
    MANAGEMENT MEDICATION 2 180 IMPROVED 1
    MANAGEMENT MEDICATION 2 190 NOCHANGE 2
    MANAGEMENT MANAGEMENT 1 200 FILED 1
    You'll also note we need to return the data in order of the root_dac_code, then parent_dac_code, followed by the display_seq.
    Does anybody know how to write this query in an elegant and optimal manner?
    Many thanks for any help!
    Cheers,
    CM.

    Flakey model.
    Why does data_elements.dac_code appear to refer to data_categories.name rather than data_categories.dac_code?
    You do not appear to be ordering by root_dac_code, parent_dac_code and display_seq (if you were MANAGEMENT/MANAGEMENT would not be at the end). Did you perhaps mean ORDER BY root_dac_code, des_id, display_seq?
    Something like this perhaps?
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> CREATE TABLE data_categories (
      2    dac_code NUMBER,
      3    name VARCHAR2 (30),
      4    parent_dac_code NUMBER);
    Table created.
    SQL> INSERT INTO data_categories VALUES (10, 'MANAGEMENT', NULL);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (20, 'MEDICATION', 10);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (30, 'PROCEDURE', 10);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (40, 'SURVEY', NULL);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (50, 'ASSESS', NULL);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (60, 'NATURE', 50);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (70, 'OBSERVE', 60);
    1 row created.
    SQL> CREATE TABLE data_elements (
      2    des_id NUMBER,
      3    name VARCHAR2 (30),
      4    parent_des_id NUMBER,
      5    dac_code VARCHAR2 (30),
      6    display_seq NUMBER);
    Table created.
    SQL> INSERT INTO data_elements VALUES (100, 'DOSE', NULL, 'MEDICATION', 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (110, '1MG', 100, NULL, 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (120, '2MG', 100, NULL, 2);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (130, '3MG', 100, NULL, 3);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (140, 'ROUTE', NULL, 'MEDICATION', 2);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (150, 'ET', 140, NULL, 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (160, 'EM', 140, NULL, 2);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (170, 'RESPONSE', NULL, 'MEDICATION', 3);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (180, 'IMPROVED', 170, NULL, 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (190, 'NOCHANGE', 170, NULL, 2);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (200, 'FILED', NULL, 'MANAGEMENT', 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (210, 'INPUT', NULL, 'OBSERVE', 1);
    1 row created.
    SQL> SELECT dc.root_dac_code, de.parent_dac_code,
      2         de.des_level, de.des_id, de.name, de.display_seq
      3  FROM  (SELECT LEVEL des_level, des_id, name, parent_des_id,
      4                CONNECT_BY_ROOT (dac_code) parent_dac_code, display_seq
      5         FROM   data_elements da
      6         START WITH parent_des_id IS NULL
      7         CONNECT BY PRIOR des_id = parent_des_id) de,
      8        (SELECT CONNECT_BY_ROOT (name) root_dac_code, name dac_code
      9         FROM   data_categories
    10         START WITH parent_dac_code IS NULL
    11         CONNECT BY PRIOR dac_code = parent_dac_code) dc
    12  WHERE  de.parent_dac_code = dc.dac_code
    13  ORDER BY dc.root_dac_code, de.des_id, de.display_seq;
    ROOT_DAC_CODE  PARENT_DAC_CODE   DES_LEVEL DES_ID NAME    
    ASSESS         OBSERVE                   1    210 INPUT   
    MANAGEMENT     MEDICATION                1    100 DOSE    
    MANAGEMENT     MEDICATION                2    110 1MG     
    MANAGEMENT     MEDICATION                2    120 2MG     
    MANAGEMENT     MEDICATION                2    130 3MG     
    MANAGEMENT     MEDICATION                1    140 ROUTE   
    MANAGEMENT     MEDICATION                2    150 ET      
    MANAGEMENT     MEDICATION                2    160 EM      
    MANAGEMENT     MEDICATION                1    170 RESPONSE
    MANAGEMENT     MEDICATION                2    180 IMPROVED
    MANAGEMENT     MEDICATION                2    190 NOCHANGE
    MANAGEMENT     MANAGEMENT                1    200 FILED   
    12 rows selected.
    SQL>

  • How can I use one hierarchical table as a node of another hierarchical tabl

    I have a requirement where I have two hierarchical tables and one table should  work as node for other table . How to achieve this??
    To elaborate more the structure is like
    Main Table (Company Structure)
    Sub table “Consolidation Groups” which has got hierarchical structure
    Sub table “Entity” which is also hierarchical.
    The Entity table should act as a node for table “Consolidation Groups”
    How can I achieve this functionality??
    Thanks
    Suvarna

    you misunderstood me apparently. I said you can't organinze to tables so one serves as a node's value of the other. Let me show you wnat I suggested by an example.
    First table has such values:
    -A
    |-B
    |-C
    and the second one is
    -x
    |-y
    |-z
    -p
    |-r
    |-s
    I thought you wanted to confine relationships between them so fo B node be able to select only x's branch and for C - only p's branch. If it's similar to the truth then let's create another table with two fields. Field one points to table containing capital letters and field two - lower case letters. Both fields are of type lookup pointing to an hierachial tables. Now when you populate this table you'll create records like (I list two columns):
    B - y
    B - z
    C - r
    C - s
    from your orinal table from now you should point to the above table. So instead of having two fields each pointing to its own table and compeling you to think how to organize two hierarchies, now you have only one field pointing to a table with all valid combinations. When you populate this table though YOU have to decide what such combinations are. It may make sense (if you have different users) to restrict access to this table on read-only level  for regular users to preserve the valid combinations.
    Hope it helps but if I understood your wrong give a concrete example.

  • How to effectively manage large table which is rapidly growing

    All,
    My environment is single node database with regular file system.
    Oracle - 10.2.0.4.0
    IBM - AIX
    A tablespace in this database is growing rapidly. Especially a single table in that tablespace having "Long Raw" column datatype has grown from 4 GBs to 900 GBs in 6 months.
    We had discussion with application team and they mentioned that due to acquisitions, data volume is increased and we are expecting it to grow up to 4 TBs in next 2 years.
    In order to effectively manage the table and to avoid performance issues, we are looking for different options as below.
    1) Table is having date column. With that thought of converting to partitioned table like "Range" partitioning. I never converted a table of 900 GBs to a partitioned table. Is it a best method?
         a) how can I move the data from regular table to partitioned table. I looked into google, but not able to find good method for converting to regular table to partitioned table. Can you help me out / share best practices?
    2) In one of the article, I read, BLOB is better than "Long RAW" datatype, how easy is to convert from "Long RAW" datatype. Will BLOB yield better performance and uses disk space effectively?
    3) Application team is having purging activity based on application logic. We thought of using shrinking of tables option with enable row movement- "alter table <table name> shrink space cascade". But it is returning the error that table contains "Long" datatype. Any suggestions.
    Any other methods / suggestions to handle this situation effectively..
    Note: By end of 2010, we have plans of moving to RAC with ASM.
    Thanks

    To answer your question 2:
    2) In one of the article, I read, BLOB is better than "Long RAW" datatype,
    how easy is to convert from "Long RAW" datatype. Will BLOB yield better
    performance and uses disk space effectively?Yes, LOBs, BLOBs, or CLOBs are (supposed) to be better than raws (or long raws). In addition, I believe Oracle has or will shortly be desupporting the use of long raws in favor of LOBs, CLOBs, or BLOBs (as appropriate).
    There is a function called "to_lob" that you have to use to convert. Its a pain because you have to create the second table and then insert into the second table from the first table using the 'to_lob' function.
    from my notes...
    =================================================
    Manually recreate the original table...
    Next, recreate (based on describe of the table), except using CLOB instead of LONG:
    SQL> create table SPACER_STATEMENTS
    2 (OWNER_NAME VARCHAR2(30) NOT NULL,
    3 FOLDER VARCHAR2(30) NOT NULL,
    4 SCRIPT_ID VARCHAR2(30) NOT NULL,
    5 STATEMENT_ID NUMBER(8) NOT NULL,
    6 STATEMENT_DESC VARCHAR2(25),
    7 STATEMENT_TYPE VARCHAR2(10),
    8 SCRIPT_STATEMENT CLOB,
    9 ERROR VARCHAR2(1000),
    10 NUMBER_OF_ROWS NUMBER,
    11 END_DATE DATE
    12 )
    13 TABLESPACE SYSTEM
    14 ;
    Table created.
    Try to insert the data using select from original table...
    SQL> insert into SPACER_STATEMENTS select * from SPACER_STATEMENTS_ORIG;
    insert into SPACER_STATEMENTS select * from SPACER_STATEMENTS_ORIG
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype
    That didn't work...
    Now, lets use TO_LOB
    SQL> insert into SPACER_STATEMENTS
    2 (OWNER_NAME, FOLDER, SCRIPT_ID, STATEMENT_ID, STATEMENT_DESC, STATEMENT_TYPE, SCRIPT_STATEMENT, ERROR, NUMBER_OF_ROWS, END_DATE)
    3 select OWNER_NAME, FOLDER, SCRIPT_ID, STATEMENT_ID, STATEMENT_DESC, STATEMENT_TYPE, TO_LOB(SCRIPT_STATEMENT), ERROR, NUMBER_OF_ROWS, END_DATE
    4 from SPACER_STATEMENTS_ORIG;
    10 rows created.
    works well...
    ===============================================================

  • Hierarchical table in Adobe

    Hi All,
              I want to know is there any work around to create a Hierarchical table in Adobe Interactive Forms?I need 2 levels of hierarchy(means 2 master columns in a single table)
    regards
    Sumit

    hi Sumit...
    This might be helpful for you... See this PDF file URL;
    If it will be helpful for you means reward some points...
    <b>
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c29a4d25-0c01-0010-50ae-e69d0e1c61f3</b>
    Urs GS

  • Hierarchical Table Commands in MDM API

    Hi,
    I found only RetrieveLimitedHierTreeCommand,RetrieveLimitedHierChildrenCommand in MDM API for hierarchical tables.
    So how can we add a child or a sibling, delete a child or sibling to the nodes of the tree.
    Can anyone please give me links or some documentation on how to proceed with this.
    The other problem we are facing when retrieving the children using RetrieveLimitedHierTreeCommand
    When we add a search on the command it does not retrieve the children. it says the children for the level one node are null but if i donto set search it retrieves the children for all the nodes.
    Is there any specific setting that has to be done for using the search.
    Please let me know
    Thanks,
    Padmaja

    Hi Greg,
    I am adding the code snippet below. Can you please look into this and check if there are any problems
    RetrieveLimitedHierTreeCommand hr=new RetrieveLimitedHierTreeCommand(conAccessor);
    Search ser=new Search(repoSchemacmd.getRepositorySchema().getTable("New_Code").getId());
    FieldId fldId =repoSchemacmd.getRepositorySchema().getTableSchema("New_Code").getField("New_Code").getId();
    StringValue fldVal = new StringValue("G0440");
    ser.addSearchItem(new FieldSearchDimension(fldId),new TextSearchConstraint(fldVal.getString(),TextSearchConstraint.EQUALS));
    hr.setSearch(ser);
    ResultDefinition rd=new ResultDefinition(repoSchemacmd.getRepositorySchema().getTable("New_Code").getId());
    rd.setSelectFields(repoSchemacmd.getRepositorySchema().getTableSchema("New_Code").getFieldIds());
    hr.setResultDefinition(rd);
    hr.setSession(userSessionID);
    try {
         hr.execute();
    } catch (CommandException e) {
        e.printStackTrace();
    When i execute this part of code and get the children. i get the children as null.
    Thanks,
    Padmaja

  • Navigate to needed row in hierarchical table

    Hello everyone.
    I have a problem related to Table UI Element. In my case it has hierarchical structure. By default, all nodes are collapsed. I need to provide user with ability to find nessesary element: if it's leaf, then all parents above have to be expanded and row is selected. I did this. Unfortunately, if found row has big index, it isn't displayed and I have to scroll down to find my selected row. I know that I can set "FIRST_VISIBLE_ROW" property of table. But how can I determine index? Internal table which is the source for hierarchical table has different number of rows. For example my internal table has 700 rows, when in the UI table only 120 rows are displayed.

    Does anybody know?

  • Hierarchical table

    Hi experts,
    I have a hierarchical table.  This is a normal Table with a mastercolumn, and the mastercolumn is binded to a recursive context node. The context node has a supply function which reads the data when the tree is selected in the table.
    My question is:  Is there a was to expand all  nodes of the table? As I see this cannot be done, because even if I call the supply function, with the parent element, I cant provide the "node" parameter of the supply function..
    Am I right?
    Thanks
    N.

    Hello everyone,
    It's possible here is the solution (You start calling this recursive method form an action where you get the root of your tree):
    METHOD rec_subobj .
      DATA: ls_nodes      TYPE wdr_context_child,
            lt_nodes      TYPE wdr_context_child_map,
            lt_all_nodes  TYPE wdr_context_child_map,
            lt_elements   TYPE wdr_context_element_set,
            lref_element  TYPE REF TO if_wd_context_element,
            lt_subobj TYPE wd_this->elements_bonus_sub_obj,
            ls_subobj TYPE wd_this->element_bonus_sub_obj,
            lv_counter TYPE NUMC3.
      LOOP AT pt_nodes INTO ls_nodes.
    *    First set the expanded flag.
        CALL METHOD ls_nodes-node->get_static_attributes_table
          IMPORTING
            table = lt_subobj.
        LOOP AT lt_subobj INTO ls_subobj.
          ls_subobj-expanded = abap_true.
          MODIFY lt_subobj FROM ls_subobj.
        ENDLOOP.
        ls_nodes-node->bind_table( lt_subobj ).
    *   We've expanded on the current level, now colect the subobjects and recall this function
        CALL METHOD ls_nodes-node->get_elements
          RECEIVING
            set = lt_elements.
        LOOP AT lt_elements INTO lref_element.
          lref_element->get_static_attributes( IMPORTING    static_attributes = ls_subobj ).
          CALL METHOD lref_element->get_child_nodes
            RECEIVING
              child_nodes = lt_nodes.
    *     lt nodes is a hashed table
          LOOP AT lt_nodes INTO ls_nodes.
    *       lt_nodes is a hashed table, so we have to change the name :)
            CONCATENATE ls_nodes-name lv_counter INTO ls_nodes-name.
            INSERT ls_nodes  INTO TABLE lt_all_nodes.
            lv_counter = lv_counter + 1.
          ENDLOOP.
        ENDLOOP.
      ENDLOOP.
      IF lt_all_nodes IS NOT INITIAL.
        wd_this->rec_subobj(  pt_nodes =  lt_all_nodes    ).
      ENDIF.
    ENDMETHOD.
    I should be able to give points to myself

  • How to manage the tables after deploying an SDA for Oracle

    How can I manage the tables after deploying an SDA  on Oracle.There is tool for MaxDB,but how can I connection to the Oracle Database?
    Thanks

    In J2ee administrator console

  • Profile management meta tables list

    Hi ,
    Does anyone has the complete list of the profile management meta tables ?
    Thanks in advance.
    Dennis

    Hi,
    Apply this "patch" on your Demo environment and you will have all ERD's based on component/pages including Profile Management.
    PeopleSoft Enterprise Human Capital Management 9.1 Entity Relationship Diagrams [ID 968850.1]
    https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=REFERENCE&id=968850.1
    Regards,
    Hakan

  • Analytic Workspace Manager - Hierarchies within hierarchies

    Hi,
    We have six levels of Sales Groups (SG) and two levels of Sales Personnel (SP).
    - SG1
    SP1- Sales Manager
    SP2- Sales Rep
    - SG2
    SP1
    SP2
    - SG3 ... so on and so forth
    We want to have drill down capability on SG1 so that we see SP levels underneath followed by the next level Sales Group i.e. SG2.
    My question is can we have hierarchies within hierarchies using Analytic Workspace Manager and can this be queried using Discoverer Plus for OLAP. If there is another way to do it, can someone please explain?
    Thanks again,
    -Esther

    I am not totally sure what you are trying to achieve as I think you might be confusing members with levels. From an OLAP perspective we support two basic types of hierarchies
    - Level based
    - Value based (Parent-Child)
    Within level based we additionally support:
    - normal
    - ragged
    - skip level
    Normal implies that you have a hierarchy where the each member for each level always has a parent at a the next level up in the hierarchy. Ragged hierarchies are where data is loaded at different levels within the hierarchy and skip level is where parents within a specific level are themselves defined at multiple levels.
    I am not sure if this answers your question, but you can find more information on how to manage hierarchies in the
    Oracle® OLAP Application Developer's Guide
    Section 3 Creating an Analytic Workspace
    Creating Hierarchies
    http://www.oracle.com/technology/products/bi/olap/OLAP_App_Dev_Guide_10.2.zip
    Hope this helps
    Keith
    Oracle Business Intelligence Product Management
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Beans http://www.oracle.com/technology/products/bib/index.html
    Discoverer: http://www.oracle.com/technology/products/discoverer/
    BI Software: http://www.oracle.com/technology/software/products/ias/devuse.html
    Documentation: http://www.oracle.com/technology/documentation/appserver1012.html
    BI Samples: http://www.oracle.com/technology/products/bi/samples/
    Blog: http://oraclebi.blogspot.com/

  • I Want manage cluster table view . I control this  table

    Hi Abaper ;
    I Want manage cluster table view . I control this  table ( which cell change or delete or add  ) I use total internal table ( creating by system ) but total table has a line and some data is incorrect .
    for example :
    in database data :
                                term      stundet_name          lesson_id          lesson_name    
                                2005          ahmet                       1                  Matematik
                                2005          yasin                        2                      Tarih
    I view data   
                                term      stundet_name          lesson_id          lesson_name    
                                2001          ahmet                       1                  Matematik
                                2001          yasin                        2                      Tarih
    (term data false)

    Hi Turgut
    Check this out ; I dont try but maybe useful for you.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a1/e4521aa2f511d1a5630000e82deaaa/content.htm

  • Best way to create hierarchies tables

    Good morning all,
    I wanted to discuss the best practices of creating hierarchies to be consumed by OBIEE. As far as I understand, OBIEE has been optimized to use flattened hierarchies, such as:
    ROW_WID CITY COUNTRY
    1 NEW YORK CITY USA
    2 MOSCOW RUSSIA
    3 KIEV UKRAINE
    4 SYDNEY AUSTRALIA
    5 ATLANTA USA
    Let's call it option 1. The only problem with this is that it has a potential to grow very wide. Also, There's a chance for confusion when there're duplicate entries, such as "New York" (city) and "New York State". Also, it's not always possible to define hierarchical relationships between data in a flat table - so-called ragged hierarchies. I found two major way of dealing with those (stack and flattening them out). Are there any other ways to deal with those? Specifically, I'm interested in dealing with hierarchies that involve complex positioning (a person might be a manager vertically, but managed horizontally - or - a person can have 2 managers - on different levels).
    Also, in the example above - can I create dimensional outriggers (assign surrogate keys instead of text values to the dim - such as having NEW YORK as 100, MOSCOW as 200)? Sort of snowflaking a dimension. I was asked to do a proof of concept for this - but haven't been successful so far. If yes, could you please provide a simple Dim Outrigger < Dim < Fact diagram.
    Thank you

    Thanks Peter - I've checked that document before (I believe it's based on Kurt Wolffe's document on Siebel Analytics which I checked as well).
    This option is fine if you're not going to do frequent changes - but in my case - it'll be a hell to maintain. We're sort of trying to prototype best solution - and it seems as flattening hierarchies is the best option, of course, given its limitations.
    Also, there's another option of taking a different path and splitting and then building separate hierarchies

  • Layout Management in Table Control

    Hi Dialog Programming Experts,
    I have a new requirement - adding Layout Management options in Table Control. This is dialog/module programming, not ALV Report. Is there a function module for this?
    Thanks so much in advance for your help.
    Regards,
    Joyreen

    Hi
    For filter use the following function modules,
    l_rightx-id = l_index.
      l_rightx-fieldname = 'DESCR'.
      l_rightx-text = text-054.
      APPEND l_rightx TO i_rightx.
      l_index = l_index + 1.
      CLEAR l_rightx.
      l_rightx-id = l_index.
      l_rightx-fieldname = 'DEL_CM'.
      l_rightx-text = text-055.
      APPEND l_rightx TO i_rightx.
    CALL FUNCTION 'CEP_DOUBLE_ALV'
           EXPORTING
                i_title_left  = text-034
                i_title_right = text-035
                i_popup_title = text-036
           IMPORTING
                e_cancelled   = l_cancelled
           TABLES
                t_leftx       = i_leftx[]
                t_rightx      = i_rightx[].
    Firstly populate the right table with all fields which you want in the filtering condition. The left table will be populated once the use selects some fields and transfer it to the left portion of the dialog.
    Then use the following FM like this.
    DATA: i_group TYPE lvc_t_sgrp.
          CALL FUNCTION 'LVC_FILTER_DIALOG'
               EXPORTING
                    it_fieldcat   = i_fldcat1
                    it_groups     = i_group
               TABLES
                    it_data       = i_ziteminvoice[]
               CHANGING
                    ct_filter_lvc = i_filter
               EXCEPTIONS
                    no_change     = 1
                    OTHERS        = 2.
    here filter table should have fields from left table above.
    Once you get the filter data, populate range table for each fields and then delete your internal table using these range.
    CASE l_filter-fieldname.
                  WHEN 'ITMNO'.
                    l_itmno-sign = l_filter-sign.
                    l_itmno-option = l_filter-option.
                    l_itmno-low = l_filter-low.
                    l_itmno-high = l_filter-high.
                    APPEND l_itmno TO li_itmno.
                    CLEAR l_itmno.
    DELETE i_ziteminvoice WHERE NOT  itmno IN li_itmno OR
                                          NOT  aedat IN li_aedat OR...
    First check this if it works, else let me know.
    Thanks
    Sourav.

  • Import Manager Join Tables not working

    Hi Experts,
    for combining tables in the Import Manager i tried to use the join and lookup function.
    My easy example is:
    Table1
    Product ID
    Organsation ID
    Table2
    Organisation ID
    Plant
    Now I'm joining using the field Organisation ID which contains the same items and make a lookup on the field Plant. In the Source Preview I can see the looked up field but without any values and it is with a grey background.
    Any suggestions?
    Thanks
    Andy

    Hi,
    I tried this at my end. It seems like a Bug. I am using MDM 7.1 SP3.
    Facing same issue, I mean Grey background (not editable) in source preview, when we look-up field Plant from Table1 to Table2.
    This field values are seen mapped in Map Fields/Values tab, but when i import data. Fields get populated for Product ID and Organization ID only but Plant field is not getting populated into MDM data Manager.
    So, i am quite sure it seems like a Bug and I would Suggest you to Raise OSS note for the same.
    Temporarily, You can import data in below manner.
    I mean when you select Source table as Table1, you can import Product ID and Organization ID.
    After importing Table1, select your Source table as Table2 map both fields Organization Id and Plant.
    Import data by selecting Matching Field as Organization ID and Default Import Action as Update (All Mapped Fields).
    So, in this way you can have your complete data in your MDM but obviously just because of bug which you can do in Single Step, Now going to be done in two Steps.
    Note: For one of Client i did this on MDM 5.5 SP6, that time it was working perfectly.
    Thanks and Regards,
    Mandeep Saini

Maybe you are looking for