Building an hierarchy in Universe

Hi,
Please help us how to build a Hierarchy based on particular values. i.e we need to create an hierarchy in universe level(for ex: Derived Table) and database is SQL Server.
hierarchy : Year->Quarter->month-> date
For date object the query is current date value. (this we can get)
Month -> It should be last day on of the day value in that particular month(i.e if jan is the month then we should get 31st value as month value)
Quarter -> It should be last day value of the quarter (i.e if quarter =2 then we should get quarter 2 value as june 30th value)
Year-> last day of the year as year value.
Thanks In Advance

Hi Suresh,
So you want to create a Hierarchy where you would be combining multiple dimensions such as Year > Quarter > Month > Date.
Create a new hierarchy from hierarchy editor, Tools > Hierarchies.
When hierarchy editor opens you will see all available objec in your universe on the left side of the pane.
You have to add required objects on the right side.
When you are creating new hierarchy you are creating new new folders in the custom hierarchy pane and then adding required dimensions.
Here are the steps...
1. From the Hierarchies editor, click the New button.
2. Type a name for the hierarchy.
3. Press RETURN to apply the name.
4. Select the new hierarchy.
The hierarchy is highlighted.
5. Expand a default hierarchy node in the left pane.
This is the hierarchy that contains dimensions that you want to add to the
new custom hierarchy.
6. Click a dimensions you want to add
Now come to your other issue for selecting last day of the month etc. For this you will have to write down formulas to achieve this functionality.
Regards,
Bashir Awan

Similar Messages

  • Building the Hierarchy in Express Administrator

    Hi,
    I have created few dimentions and Fact using Oracle Express Administrator and have imported the relational table data into them. Now I want to build the hierarchy for my time dimention (Year, Month, Quarter, Date). How to do that efficiently? I have tried "Edit data" option and have created the hierarchy manually by dragging and dropping the data for the "Standard" hierarchy, but it does not seem to be a good way-out as I have more than 5years data (date) in 4 different levels. Can anybody give me a better solution to build the hierarchy?
    Thanx in advance

    Hi Supriyo,
    You have to offer the parent-child relationship information to Express. Your relational table data structure should contain a parent field like this (";" = field separator):
    2000
    2001
    2002
    Q1-00;2000
    Q4-02;2002
    01-00;Q1-00
    12-02;Q4-02
    01-01-00;01-00
    12-31-02;12-02
    Then You can use Import item (I suppose from menu File) or - for dimensions easier way - using wizard but I don't remember where to find it. The result is the same. It will lead You through describing Your input data structure, then it reads the data and updates all appropriate metaobjects. But I'm not sure where the input data can be in a relational table - we used text files.
    Input data are read using self-generated loader (in SPL) - I can offer You it's generalized but simplified version. If You don't know SPL, You can ignore it. Otherwise You can implement it for Your purposes - I think it's possible to read the data directly from relational tables (read doc. & Help).
    The program has three parameters - name of the input file, name of the dimension and name of the hierarchy (You can have more hierarchies in a dimension - then it's the preferable to have each in a separate file).
    We consider 4 fields:
    1. dimension value
    2. long label
    3. short label
    4. parent (as shown in the example above)
    (each column means separate Express object; You can add other columns when You define objects for them first and modify the program)
    define Prg_AktDim program
    "consider Prg_AktDim
    program
    argument jms text
    argument jmDim text
    argument jmHie text
    variable prefixDb text
    variable prefixDim text
    variable f integer
    vrb _Pass integer " current pass or NA if one-pass "
    vrb _tStart text " text start delimiter "
    vrb _TEnd text " text end delimiter "
    vrb _FSep text " field separator "
    prefixDb = extchars (obj(property 'SHORTLABELVAR' jmDim) 1 3) "30.5. joinchars (upcase (extchars (dtb(name) 1 2)) '.')
    if extchars (prefixDb 3 1) ne '.'; then prefixDb = extchars (prefixDb 1 2)
    prefixDim = obj(property 'idcode' jmDim)
    _Pass = 2
    _TStart = '"'
    _TEnd   = '"'
    _FSep   = ';'
    if not isValue (&joinchars (prefixDb prefixDim '.HIERDIM'), jmHie)
    then maintain &joinchars (prefixDb prefixDim '.HIERDIM') add jmHie
    trap on error
    f = fileopen(jms read)
    " FILEREAD SPECIFICATIONS for pass 2 "
    fileread f -
    structured textstart TStart textend TEnd delimiter _FSep -
    FIELD 1 STRIP append &jmDim -
    FIELD 2 STRIP &joinchars (prefixDb prefixDim '.SHORTLABEL') -
    FIELD 3 STRIP &joinchars (prefixDb prefixDim '.LONGLABEL') -
    FIELD 4 STRIP &joinchars (prefixDb prefixDim '.PARENT')(&joinchars (prefixDb prefixDim '.HIERDIM') jmHie) -
    &jmDim = &joinchars (prefixDb prefixDim '.PARENT')(&joinchars (prefixDb prefixDim '.HIERDIM') jmHie)
    call &('xp_dmhiercalc')(jmDim jmHie )
    fileclose f
    return
    error:
    if f ne NA; then fileclose f
    END
    The program doen't update most metaobjects (only 3 of 16:-( so I can't guarantee that the Oracle Express Objects tables (mainly Selector) will work correctly but by us it worked:-)
    Good luck!

  • Refresh on 1 universe, build+ refresh on another universe

    BO XI R2
    I can give a user rights to build a report on a universe.
    But How can I deny to build reports on another universe on which he must have refresh rights!

    Hi Arjan,
    You can apply user security at the universe level. To do this you must go tot he universe int he CMC and look at the security settings on the individual universes.
    I have done this in XI r3 but I am not sure if it is possible in r2.
    See
    Securing two universes.
    Regards
    Alan

  • User Application to build Material Hierarchy

    Hi, I would like to help users to build a hierarchy without having to maintain the hierarchy externally on a spreadsheet and upload it.  So I would like an application that would baskically present a list of materials and allow the user to drag the material to a hierarchy node. 
    1. Do most people just upload their hierarchies to create them?
    2. Is there anything out there that would help the users build a hierarchy like I mentioned?
    3. If I was to build this with Web Dynpro ABAP does anyone know any of the hierarchy tables I would need to populate or any of the standard classes I could use?
    Thanks,

    hi
    there is an application that does what you want, it is BW
    go in transaction rsh1 select 0material and start building.
    nevertheless maintaining a hierarchy on articles could be very long.
    answers to your questions
    1 -in general hierarchies that are loaded are the common ones that are delivered with standard extractors, but you can build it directly in BW, or use sets in ECC and generate the datasource for hierarchy
    2-BW tx rsh1,2 and 3
    3- i don"t remember the names for articles hierarchy (i guess you speak about industry solution) but have a look to table like T161 or T one hundred
    bye
    Boujema

  • Organizational Unit Hierarchy in Universe

    Hi expert,
    I created a Universe from a query, in a query I have this Organizational Unit Hierarchy in the row column. In the Universe, I can see the Hierarchy name here but there is not L00 shown in the hierarchy and the level is starting from L01 to L07. After the Universe is created here, I created the report using Web Intelligence, when I add this L01 hierarchy in the report, I cannot see any data.
    Does anyone here know why? I am new to this Universe and Web Intelligience.
    Thanks!

    Hi King,
    When you generate a universe from a BEX query, you have to specify whether or not you want to generate a level 0 or not.
    If you do not have the L00, you didn't op to do so. You can do this in a refresh structure or with a fresh generate (in the latter case, check your defaults).
    Now L00 will be the "all" level. So that may not be your problem.
    Did you select at least a key figure in your webI query?
    Test what results you get for certain selections when you run the BEX query directly.
    Then using the same conditions, you should get the same results in WebI.
    Good luck,
    Marianne

  • Dashboard Builder integration with BO universe

    Hello,
    I want to find out if we can drill down from one dashboard to another dashboard and then another dashboard in Xcelsius Enterprise.
    I know that we can drill down from one level to another, however there are no examples in it.
    Alternatively, you can drill drown in Dashboard Builder also, and I heard that dashboard Builder also connects to the universe data.  Is it easy to you dashboard Builder instead.
    Thanks
    Abhijit

    Try the following and see what happens:
    <%@ page import="com.crystaldecisions.sdk.exception.SDKException,
    com.crystaldecisions.sdk.framework.*,
    com.crystaldecisions.sdk.occa.infostore.*"
    %><%
    IEnterpriseSession enterpriseSession;
    String serializedSession;
    /*  * Set Enterprise Logon credentials. */
    final String BO_CMS_NAME  = "MyCMSName";
    final String BO_AUTH_TYPE = "secEnterprise";
    final String BO_USERNAME  = "MyuserName";
    final String BO_PASSWORD  = "MyPassword";
    Set Java InfoView start page URL
    final String INFOVIEW_URL = "http://<hostname>:<port>/InfoViewApp/logon/start.do";
    Log onto Enterprise and serialize the Enterprise Session.
    enterpriseSession = CrystalEnterprise.getSessionMgr().logon(BO_USERNAME,BO_PASSWORD, BO_CMS_NAME, BO_AUTH_TYPE);
    serializedSession = enterpriseSession.getSerializedSession();
    Redirect to InfoView, passing the serialized Enterprise Session.
    response.sendRedirect(INFOVIEW_URL + "?ivsLogonSession=" + java.net.URLEncoder.encode(serializedSession));
    %>

  • Building Tree hierarchy Using nested loops and class cl_gui_column_tree

    Hello gurus,
    I want to create a tree report using custom container and class cl_gui_column_tree. I have read and understood the standard demo report which SAP has provided i.e. SAPCOLUMN_TREE_CONTROL_DEMO. But in this report all the levels nodes are created as constants and hardcoded. I want to create hierarchy using nested loops. For this i took one example of a hierarchy of VBAK-VBELN->VBAP-POSNR Like One sales order has many line items and each line item can have number of line items in billing plan.
    I have done some coding for it.
    FORM build_tree USING node_table TYPE treev_ntab
                                           item_table TYPE zitem_table.              " i created the zitem_table table type of mtreeitm in SE11.
      DATA: node TYPE treev_node,
                 item TYPE mtreeitm.
      node-node_key = root.
      CLEAR node-relatkey.
      CLEAR node-relatship.
      node-hidden = ' '.
      node-disabled = ' '.
      CLEAR node-n_image.
      CLEAR node-exp_image.
      node-isfolder = 'X'.
      node-expander = 'X'.
      APPEND node TO node_table.
      item-node_key = root.
      item-item_name = colm1.
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = 'Root'.
      APPEND item TO item_table.
      item-node_key = root.
      item-item_name = colm2.
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = 'Amount'.
      APPEND item TO item_table.
      LOOP AT it_vbeln INTO wa_vbeln.
        node-node_key = wa_vbeln-vbeln.
        node-relatkey = root.
        node-relatship = cl_gui_column_tree=>relat_last_child.
        node-hidden = ' '.
        node-disabled = ' '.
        CLEAR node-n_image.
        CLEAR node-exp_image.
        node-isfolder = 'X'.
        node-expander = 'X'.
        APPEND node TO node_table.
        item-node_key = wa_vbeln-vbeln.
        item-item_name = colm1.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_vbeln-vbeln.
        APPEND item TO item_table.
        item-node_key = wa_vbeln-vbeln.
        item-item_name = colm2.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_vbeln-netwr.
        APPEND item TO item_table.
        LOOP AT it_posnr INTO wa_posnr.
        node-node_key = wa_posnr-posnr.
        node-relatkey = wa_vbeln-vbeln.
        node-relatship = cl_gui_column_tree=>relat_last_child.
        node-hidden = ' '.
        node-disabled = ' '.
        CLEAR node-n_image.
        CLEAR node-exp_image.
        node-isfolder = ' '.
        node-expander = ' '.
        APPEND node TO node_table.
        item-node_key = wa_posnr-posnr.
        item-item_name = colm1.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_posnr-posnr.
        APPEND item TO item_table.
        item-node_key = wa_posnr-posnr.
        item-item_name = colm2.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_posnr-netpr.
        APPEND item TO item_table.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.
    Now this program compiles fine and runs till there is only one level. That is root->vbeln. But when i add one more loop of it_posnr it gives me runtime error of message type 'X'. The problem i found was uniqueness of item-item_name as all the sales order have posnr = 0010. What could be done? I tried giving item_name unique hierarchy level using counters just like stufe field in prps eg. 10.10.10, 10.10.20,10.20.10,10.20.20,20.10.10 etc.. etc.. but still i am getting runtime error when i add one more hierarchy using nested loop. Plz guide.
    Edited by: Yayati6260 on Jul 14, 2011 7:25 AM

    Hello all,
    Thanks the issue is solved. The node key was not getting a unique identification as nodekey. I resolved the issue by generating unique identification for each level. Thanks all,
    Regards
    Yayati Ekbote

  • How to build tree/hierarchy/explorer format in internal table

    Dear Friends,
    I have one internal table with parent and child, again child will be acting as parent and it can have further childs ......
    like that it goes on there is no constant levels it goes on....
    for example.
    parent child
    100 101
    102
    103
    101 201
    202
    102 301
    103 401
    402
    403
    this has to be displayed in hierarchy mode.
    here i to as a column wich has to represent its position/level in the hierarchy like:
    1
    1.1
    1.1.1
    1.2
    1.2.1
    ......n
    1.2.2...n
    1.3
    2
    2.1
    2.2
    3
    etc...
    let me know any ideas to get the maping of the rows to put it in tree format( like windows explorer).
    Thanks,
    Mahesh.Gattu

    REPORT  Z_TREE.
    TYPE-POOLS: ICON.
    TYPE-POOLS : FIBS,STREE.
    INCLUDE <ICON>.
    DATA : T_NODE TYPE SNODETEXT.
    DATA : NODE_TAB LIKE T_NODE OCCURS 0 WITH HEADER LINE.
    DATA : ITAB LIKE VBAP OCCURS 0 WITH HEADER LINE.
    DATA : ITTX LIKE MAKT OCCURS 0 WITH HEADER LINE.
    DATA : LI TYPE I VALUE 1.
    CLEAR : NODE_TAB, NODE_TAB[].
    SELECT * FROM VBAP INTO TABLE ITAB UP TO 50 ROWS.
    SELECT * FROM MAKT INTO TABLE ITTX FOR ALL ENTRIES IN ITAB WHERE MATNR = ITAB-MATNR.
    NODE_TAB-TYPE = 'T'.
    NODE_TAB-NAME = ''.
    NODE_TAB-TLEVEL = '01'.
    NODE_TAB-NLENGTH = ''.
    NODE_TAB-COLOR = '3'.
    NODE_TAB-TEXT = 'ICON_DETAIL'.
    NODE_TAB-TCOLOR = '1'.
    NODE_TAB-KIND = 'I'.
    NODE_TAB-TLENGTH = '2'.
    NODE_TAB-TEXT1 = 'Details'.
    NODE_TAB-TCOLOR1 = '2'.
    NODE_TAB-KIND = 'I'.
    NODE_TAB-TLENGTH1 = '10'.
    APPEND NODE_TAB.
    CLEAR NODE_TAB.
    LOOP AT ITAB.
      AT NEW VBELN.
        NODE_TAB-TYPE = 'P'.
    *   node_tab-name = 'Sale Number'.
        NODE_TAB-TLEVEL = '02'.
    *   node_tab-nlength = '12'.
        NODE_TAB-TCOLOR = '4'.
        NODE_TAB-TEXT = ITAB-VBELN.
        NODE_TAB-TLENGTH ='10'.
        APPEND NODE_TAB.
        CLEAR NODE_TAB.
      ENDAT.
    READ TABLE ITTX WITH KEY MATNR = ITAB-MATNR.
      NODE_TAB-TYPE = 'P'.
    * node_tab-name = 'LI'.
      NODE_TAB-TLEVEL = '03'.
    * node_tab-nlength = '4'.
    NODE_TAB-TEXT = 'ICON_MATERIAL'.
    NODE_TAB-TCOLOR = '1'.
    NODE_TAB-KIND = 'I'.
    NODE_TAB-TLENGTH = '2'.
      NODE_TAB-TCOLOR1 = '5'.
      NODE_TAB-TEXT1 = ITAB-MATNR.
      NODE_TAB-TLENGTH1 = '20'.
      NODE_TAB-TCOLOR2 = '7'.
      NODE_TAB-TEXT2 = ITTX-MAKTX.
      LI = STRLEN( ITTX-MAKTX ).
      NODE_TAB-TLENGTH2 = LI.
      APPEND NODE_TAB.
      CLEAR NODE_TAB.
    *  READ TABLE ITTX WITH KEY MATNR = ITAB-MATNR.
    *  NODE_TAB-TYPE = 'P'.
    ** node_tab-name = 'LI'.
    *  NODE_TAB-TLEVEL = '03'.
    ** node_tab-nlength = '4'.
    *  NODE_TAB-TCOLOR1 = '7'.
    *  NODE_TAB-TEXT1 = ITTX-MAKTX.
    *  LI = STRLEN( ITTX-MAKTX ).
    *  NODE_TAB-TLENGTH = LI.
    *  APPEND NODE_TAB.
    *  CLEAR NODE_TAB.
    ENDLOOP.
    CALL FUNCTION 'RS_TREE_CONSTRUCT'
      TABLES
        NODETAB = NODE_TAB.
    *DATA: type_mapping TYPE stree_ctl_type_mapping_tab.
    *DATA: wa_type TYPE stree_ctl_type_mapping.
    *CLEAR: type_mapping[].
    *wa_type-type = 'A'.
    *wa_type-icon = '@BL@'.
    *APPEND wa_type TO type_mapping.
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
      EXPORTING
        STATUS      = 'STANDARD'
        USE_CONTROL = 'L'.

  • Write an ABAP to build a hierarchy

    Hi,
    I have a table TVBVK that is required to be read off from to create a hierarchy. The fiedl VKBUR is used to create a root node and the field VKGRP is then to be used to create the leaves. Has anyone written a program to read from this table and then create a hierarchy? Would this be possible? How owuld I approach writing a program for this requirement?
    Thanks

    Hi Will,
    Please check this link perhaps it may help.
    http://www.sap-img.com/abap/how-to-create-tree-control.htm
    Regards,
    Ferry Lianto

  • Howto build hierarchy with Id/ShortName/Longname at levels

    I tried to build a hierarchy for an organizational structure.
    All my levels consist of an Id, ShortName and LongName of that level.
    Now when I build a hierarchy I can only select or Id or ShortName or Longname.
    I need a report where I have to drill on Id, Shortname or Longname, where all corresponding level-objects in the report have to go the same level up/down. But I can't get it to work! When I click on Id for example, Shortname and Longname will stay on the original level...  :hb:
    I get this in the report:
    Original:
    LEVEL0 ID, LEVEL0 Short, LEVEL0 Long
    After Drill on LEVEL0 ID:
    LEVEL 1 ID, LEVEL0 Short, LEVEL0 Long
    I want this:
    Original:
    LEVEL0 ID, LEVEL0 Short, LEVEL0 Long
    After Drill on LEVEL0 ID:
    LEVEL 1 ID, LEVEL1 Short, LEVEL1 Long
    Please advise how to get this!
    (Using BO XIR2 SP2 FP2.6)
    Edited by: J. van de Mheen on Jun 8, 2009 11:35 AM

    Hi,
    You cannot use concatenation of objects oin universes because it is a SAP universe and SAP MDX does not support expressions that return string.
    For your case I suggest that you turn the details objects (needed for drill) into dimensions because you can only drill on dimensions (blue objects): details (green triangles) are only used as attributes and cannot be used for drill operation.
    Regards,
    Didier

  • Hierarchies in universe build over a flat file

    Hi,
    I have buit a universe over a flat file which has a single table consisting of all the data(Dimenssions and Measures).
    When I built a WebI report over that universe the drill button in the report pannel is showing as dissabled.
    Even though I define a custom hierarchy in Universe Designer, it is the same case.
    So, Is it possible to have hierarchies in universes that are built over flat files?
    If yes, how is it done?
    Thanks,
    Viswanath.

    How to enable Drill option in Webi Report based on BW universe.
    Please check the above thread.
    Edited by: Ravi Rawat on Apr 8, 2011 8:32 AM

  • Building hierarchy trees (ragged hierarchy) in OBIEE

    We want to build a hierarchy tree to drill into the different levels of our organization. (ragged hierarchy) In OBIEE Answers or like product is there a way to expand down the page in a tree format? I am looking for what others have done to display that UI drill down similar to how the Windows registry/file system expands. Building filters across the page will not work for us. Any thoughts would be greatly appreciated. Thanks.
    Edited by: jonloring on Jun 30, 2009 12:40 PM

    I did read it and was helpful, but I am trying to solve a UI formating problem. All the BI products seem to go across the page with filtering, not down the page in a tree format.

  • Is it possible to build hierarchy (among 4-5 std. dim) in MDX query?

    Hi,
    Let's say i have 4 standard dimensions:
    Std1
    Std2
    Std3
    Std4
    Each of the above standard dimensions have their own hierarchy.
    Std1
    ==Std1_1
    ==Std1_1_1
    Std2
    ==Std2_1
    Std3
    ==Std_3_1
    Std4
    ==Std4_1
    Now, we can see that there is "NO" hierarchical relationship between any two of the above four standard dimensions.
    I would like to build a hierarchy(dynamically) in the MDX query (during retrieval), so that, the standard dimensions and the measures are retrieved in my required hierarchy.
    For example, if at runtime, i want hierarchy like the below:
    Std2
    |_ Std3
    |_Std1
    |_Std4
    Can i build this hierarchy in MDX query?
    Is there any way to do this in MDX?
    Thanks in advance.
    Regards,
    Vivek Ganesan

    What you want is a custom data formatter. I would give you some links, but my iPad wants to convert them into the documentation viewer.
    You aren't going to find much help with C++ debugging. While Apple's Clang has made great improvements in C++ support compared to GCC, C++ is really not something that Mac or iOS programmers typically use. The Cocoa containers and objects are so much more versatile. You kind of have to have a masochist streak and a 7 year development schedule to use C++. C++ is experiencing a bit of a resurgence, especially in defense markets. For a long time, compilers had such poor support for C++ that it just wasn't possible. After simplifying the language a little, compilers can now compile and link C++. Consultants have realized they can provide C++ services and burn though billable hours better than any other language on the market. Independent developer, however, don't have those schedules and budgets so they tend to use NSArray. Xcode supports it better in the debugg and, chances are, you don't need to debug it anyway. There are a number of matrix classes built on Cocoa.

  • Building hierarchy from several diffrent infoObjects

    Hello,
    I have a cube with several infoObjects – all of them are reference of 0customer. The first infoObject is country manager, the second is area managers and the third is agents. I need to build a hierarchy from these infoObjects (country manager>area managers>agents) The infoSource is designed to bring each one of them in a different cell of the extract structure (each one of them is a different infoObject). I have the complete hierarchy (with all the "managers") in 0customer.
    How can I build a hierarchy from them? I don’t want to use the "display as hierarchy" functionality.
    Please Advice,
    David

    just solved it
    I put the 0customer as external Chars. in hierarchies of itself.
    If i want to show the hierarchy: country manager>area managers>agents i should put the agent in the rows/columns and use the workers hierarchy which contains the country manager and area manager which are above the agent.
    Thank you Simon!!!
    David

  • 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

Maybe you are looking for