Create a Hierarchy

I am having a sql which has invoice date and has a index on it. I need to put parameter on this column but the user wants to enter only period name.
So if you create a hierarchy on this date column I know that performance will be really bad.
I read that if we create a dimension table and attach this to that the performance retains. Can any body explain how to create dimension folder and create a hierarchy on that, how to attach that to complex folder and make a parameter on that.
thanks in advance.
thanks
kiran

Hi Kiran
I have been waiting to answer this one so that I have some time to devote to the answer, not because I don't know what to do but because the answer will be time consuming.
Basically, the steps involved are:
1. Determine what your fiscal periods are
2. Determine what time components you want to report on
3. Build a table that would store those components
4. Populate the table using a script to fill in the appropriate fiscal components
5. Build a primary key on the date or some other user-defined unique key
6. Build a series of non-unique keys on the components required within your hierarchies - typically fiscal month, fiscal quarter and fiscal year
7. Import this table into Discoverer as your master time folder
8. Create lists of values on all of the indexed items
9. Copy the folder, using CTRL-C, once per transaction date, and paste it using CTRL-V into the appropriate business area
10. Move the new folder up under its designated transaction folder
11. Rename the folder and the items within it to reflect the date that it is going to manage - E.g. for a ship date the folder could be called SO Ship Date, with the main items being called Ship Date, Fiscal Shipped Month, Fiscal Shipped Quarter and Fiscal Shipped Year
12. Create a Discoverer hierarchy on Ship Date, Fiscal Shipped Month, Fiscal Shipped Quarter and Fiscal Shipped Year and name it Ship Date Hierarchy
13. Build a 1:N join from the calendar date in the copied folder to the transaction date - you probably also want the date in the underlying transaction table to be indexed for maximum performance
14. Hide the date in the transaction folder
Ok, now that the basic workflow has been outlined let's talk about some of the steps. Step 1 asks you to determine your fiscal periods. What this means is that you need to know the start and end date for your organization's fiscal year, and all of the fiscal periods in between.
If you are using Oracle E-Business Suite you can use the GL_PERIODS table to get this information. This table stores information about the accounting periods you define using the Accounting Calendar form in Apps. In other words, GL_PERIODS is the Apps table that contains your organization’s fiscal calendar. However, because you can have recursive joins between the elements of this table, report performance can be seriously impacted. Each row includes the start date and end date of the period, the period type, the fiscal year, the period number, and other information. There is also a one–to–many relationship between a row in the GL_PERIOD_SETS table and rows GL_PERIODS.
You can now write a simple script that will pull out the fiscal period information. Then, after you are certain that your algorithms are working, you should create a materialized view of your GL_PERIODS date hierarchy. After you have created the materialized view, you should place a unique index on the calendar date, with non-unique indexes on the months, quarters, and years. After you do this, inside your view you can now join your transaction date to the date in the materialized view and read off the hierarchy.
Most DBAs are rightly concerned about adding materialized views to E-Business Suite. In this case, because GL_PERIODS is only updated only once a year, you have a perfect candidate for a materialized view. You just need to make sure that you refresh the materialized view after you add the dates for the next year.
Now, GL_PERIODS only has information concerning fiscal periods, or months. You have to get the individual dates in there as well. Once again, if you are using Apps and you are using BOM (Bills of Material) you may well be using a table called BOM_CALENDAR_DATES. This table contains one row per date within your year. In order to join this table to GL_PERIODS you need to be able to determine which fiscal period a certain date falls in to. Having worked that one out you now join to the previous script adding a clause such as DATE >= GL.PERIODS.START_DATE and DATE <= GL_PERIODS.END_DATE where the PERIOD_TYPE is 'Month'.
Here is a script that might give you the basics:
SELECT DISTINCT
gl_mth.period_name month,
gl_mth.period_set_name set_name,
gl_mth.start_date mth_start_date,
gl_mth.end_date mth_end_date,
gl_mth.period_num mth_number,
gl_mth.last_update_date mth_last_update_date,
(gl_mth.end_date -
gl_mth.start_date) +1 mth_timespan,
gl_qtr.period_name quarter,
gl_qtr.start_date qtr_start_date,
gl_qtr.end_date qtr_end_date,
gl_qtr.quarter_num qtr_number,
gl_qtr.last_update_date qtr_last_update_date,
(gl_qtr.end_date -
gl_qtr.start_date) + 1 qtr_timespan,
gl_yr.period_name year,
gl_yr.start_date yr_start_date,
gl_yr.end_date yr_end_date,
(gl_yr.end_date -
gl_yr.start_date) + 1 yr_timespan,
gl_yr.last_update_date yr_last_update_date,
gl_yr.period_year period_year,
gl_qtr.entered_period_name actual_qtr
FROM
apps.gl_periods gl_mth,
apps.gl_periods gl_qtr,
apps.gl_periods gl_yr
WHERE
gl_mth.PERIOD_SET_NAME = 'your data set name'
AND gl_mth.period_type = 'Month'
AND gl_mth.start_date >= '01-OCT-1998'
AND gl_qtr.quarter_num = gl_mth.quarter_num
AND gl_qtr.period_year = gl_mth.period_year
AND gl_qtr.period_type = 'Quarter'
AND gl_yr.period_year = gl_mth.period_year
AND gl_yr.period_type = 'Year';
Does this help understand the logic behind creating fiscal date folder?
Best wishes
Michael Armstrong-Smith
URL: http://learndiscoverer.com
Blog: http://learndiscoverer.blogspot.com

Similar Messages

  • How to create BP hierarchy in CRM 5.0

    Hi All,
    We are planning to create customer hierarchy in our SAP CRM 5.0 system. In other words, we want to have different departments within a company to be identified as a BP while the company itself is also a BP. How to implement this in CRM?
    Greatly appreciated,
    Leon

    Hi Leon,
    Creating  a BP group (customer) hierarchy in CRM system is very easy. Please refer to the following very good help document : http://help.sap.com/saphelp_crm50/helpdata/en/12/cfea3b31aac554e10000000a114084/frameset.htm
    But in CRM 5.0 every time you create a hierarchy node and saves it, then hierarchy automatically get disappears. You need to implement the following notes in your system to get rid of this problem : 958122, 960384 and 956066
    <b>Do not forget to reward if helps</b>
    Regards,
    Paul Kondaveeti

  • Can we create a hierarchy based on two logical table in 10g RPD

    Hi,
    I have a question, please give me some clarity, about creating hierarchy,
    I know we can create a hierarchy based on one logical table which is form by two physical table...
    Can we create a hierarchy based on two logical table? If yes, and how?
    Thanks in advance!
    anne

    Use preffered drill paths...
    -suman

  • Creating a hierarchy based on a remote database link

    I am trying to create a hierarchy based on a synonym for a remote database table. The hierarchy wizard works correctly, and the table columns do appear as choices in the drop boxes. However, when I try to run the application, I get the error "No data found. This data does not exist or you do not have privileges to view it". Does anyone know how to resolve this error? Or how to work around this?
    I can successfully create and query a form based on the remote table. And, I am able to create a hierarchy from other tables (which do not use a database link) without a problem.
    Thanks for your help!

    This is the query which I am using to build a report
    SELECT
    rollup_timestamp "Date",
    max(decode(target_guid,'199F0B201A3D71A63040BADFAA4F9E90',average,0)) host1,
    max(decode(target_guid,'3FB1329F59339C07E11304B69DC4E594',average,0)) host2
    FROM "sysman.MGMT$METRIC_DAILY"
    WHERE
    (target_guid='199F0B201A3D71A63040BADFAA4F9E90'
    or
    target_guid='3FB1329F59339C07E11304B69DC4E594')
    AND
    metric_name='Load'
    AND
    metric_column='memUsedPct'
    AND
    rollup_timestamp >= to_date('01-10-2009','dd-mm-yyyy') and rollup_timestamp <= sysdate
    GROUP BY rollup_timestamp
    ORDER BY "Date"
    And for your previous question I couldn't even create a page.
    Regards
    Balaji
    Edited by: user7290747 on 6/01/2010 16:17

  • How to create a hierarchy Tree

    Oracle Forms 6i
    Hai All
    Could Any Tell me the steps to create a hierarchy tree in oracle forms
    My table is employee_master and fields are
    Empcode number ,
    Empname varchar,
    deptcode number,
    gradecode number and etc
    Here i need to create a tree with Deptcode in that every employees are seperated by grade code
    Thanks In Advance
    Srikkanth.M

    Dear,
    If you get any problem while creating tree, will help you step by step.....
    Thank you,

  • How to create a Hierarchy Node Variable to be used in Infopackages ?

    Hello,
    I use BW 3.5.
    I need to create a hierarchy node variable (filter) to be used further in Infopackages as OLAP Variable.
    How can I do ?
    Please give a step-by-step answer,
    Thank you very much,
    Thomas

    Hi Again,
    You can use ABAP program in the process chain.
    I guess there are some OS level commands in ABAP which will allow you to open, close, read , write and move files.
    Serach in ABAP help or on net.
    Bes regards,
    Sunmit.

  • How to create a hierarchy info source

    Please give a step by step procrdure of how to create a hierarchy info source

    Hi,
    Check this blog:
    Hierarchy Upload from Flat files
    Bye
    Dinesh

  • Creating a Hierarchy Viewer query

    Hello,
    I'm having huge difficulties creating a Hierarchy Viewer Query. I've looked through the source code contained withing the demo, but it seems to require great knowledge regarding the component. I'm using a three-node model, each node grouped within it's parent.
    So I created a custom View to be used as a result list for the query and this part is working just fine. I can pick the unique ID for the node I want from the search results when the user selects one, but I don't know how I can make that specific node my "anchor", my "current node", after that.
    Since I'm looking for a specific "contact_id" selected from the search results, I think the correct way of doing it is finding it's node on the TreeModel, and then setting it as my current anchor.
    Please, any tips, directions or suggestions on how can I go about doing this?
    Thanks!!

    Hi!
    Thanks for the attention, but I've been through all the basic stuff. The HV documentation only teaches the most primitive part of it. I searched all blogs related to HV, all articles I could find, I've meddled with the demo source code and all I can think of, but I couldn't find anyone who would give much insight on the mechanics of the component or how to build a really powerful search engine for it.
    As a sugestion for the developer team, it would be great if the query for this component allowed us to specify actions to be performed on all levels of the tree, instead of only the root node, since most of the time people use HV as a multi-root tree.

  • Unable to create position hierarchy in organization model

    I was unable to create position hierarchy in organizational hierarchy. I want to maintain position hierarchy within an organization. But SAP CRM is not allowing that. I was able to create organizational hierarchy. Please let me know, how can I maintain the position hierarchy within the same organization?
    --hari

    Hi hari,
    it is only possible to have a hierarchy with two levels on position level. Therefore you create two positions below your organization (tx ppoma_crm). At one of these positions you set the flag "Head of own organizational unit" at the Basic data tab of the position (To see this, you need to display the Details of the positions at the bottom of the screen). Now you can assign a business partner (or more)  to this position which is (are)  the Head of this unit.
    If you need a more complex hierarchy you have to use organizations to show this.
    Hope it helps!
    Kind regards
    Christian

  • How to create an Hierarchy from 2 tables in Essbase

    Hi,
    Currently We have 5 dimension tables and one fact table in Star Schema Model.We have requirement to create an hierarchy which pulls from multiple tables
    For Eg:
    Table:1 P1 P2
    Table:2 Q1 Q2
    Expected Hierarchy :
    P1
    Q1
    While we try to implement it shows inconsistent results.Can some one let me know the alterante solution to fulfill this requirement.
    Thanks,
    SatyaB

    Your JOIN doesn't work?
    You'd have to post what the tables look like, what you're joining on, etc., etc. You aren't supplying enough information.
    I am (to put it kindly) a SQL hack. I have found that if I go to a company's dba with my childlike SQL and ask, "Can you improve this?" almost 100% of the time they take pity on me and improve my code to no end. I know that's not what a dba is really for, but they tend to like well formed SQL touching their databases. Failing that, is there someone at your firm that is good with SQL who can help? You're on an Essbase board, not a SQL board, so you are likely not going to get the help you need here.
    Regards,
    Cameron Lackpour

  • How to Create New Hierarchy and Group Codes

    Hi,
    I have a requirement for create New Hierarchy Code and Group Codes...
    Please let me know the procedure of it..
    Thanks...

    solved

  • Creating A hierarchy on a characteristic.

    Hi,
    I am in process of creating a hierarchy. the problem I face is with number of hits getting displayed in the input help. I have got an overall of morethan 1500 entries, but the input help is giving me only 500 hits at a time.
    How can I get the full list of input help.
    Regards,
    Naveen.A

    When you have the list of value, choese restrict value botton and you can choose the number of hit to select.
    Regards

  • Create different hierarchy based on Dimension values

    I have a dimension called period. This dimension is having 4 different types of periods. The period table looks as below. I need to create 4 different hierarchies for these 4 types of periods based on l1 to l5 values. But all these values are in the same
    table. Is it possible in SSAS? If so please let me know how can I do it. 

    If i understand it correctly, you want one hierarchy for one row, then you need to flat the table in the view and then you can create those hierarchy. But it is no different from having one hierarchy with the table you have. your hierarchy is going to look
    like "Priod5"  <- "Priod4" <- "Priod3" <- "Priod2" <- "Priod1". this hierarchy will have all the values. Don't forget to use the composite key for each attribute except key attribute.
    hope this is helpful.
    prajwal kumar potula

  • Create Customize Hierarchy in BW

    Hi All,
    As per my requirement i have to create a customize hierarchy in SAP BW system, could one please suggest me how to create customize hierarchy in BW system.
    I know that in R/3 by using BW07 and BW10 we can create the Hierarchy by using Z or on standard table we can create, but my requirement is to create in BW.
    A big please to everyone to respond ASAP with possibilities.
    thanks,
    p

    Hi Prashanth,
    To create hierachy in BW/BI , First of all you need to make the characterstic 'With hierarchies'
    Right click on the characterstic(Z_SREP, for example) --> Change
    Go to Hierarchy Tab ---> check 'With hierarchies' check box
    activate the characterstic
    then right click on the same characterstic and say Create Hierarchy
    Enter a name and a description, and then click continue
    Right-click charactersctic or the right hand side area , and then select Insert characteristic node--> Insert info object ( Z_SREP) u2026. and so on...
    Let me know if you want to know more in detail,
    Hope this helps.
    Sukhi

  • Create product hierarchy & category in CRM

    Hello experts,
    I need to write a program that create product hierarchy & category in CRM 5 from flat file.
    As anyone know how to do it?
    I couldn't find any bapi, and when i tried to debug the program that transfer this data between R3 to CRM i got to dead end.
    I realy dont know how to attack this...
    regards,
    Ronen.

    USE LSMW. Even i am working on a similar thing though i need to create products in CRM from excel file. Category and hierarchy ar supplied to me. Actually there are a couple of options.
    Basically do research in SE37  with search term COMCATEGORYCREATE*    and similarly for COMCATEGORYsav*   for category  and for hierarchy replace category with 'hier' . You can then shortlist which FM is good for you and try to construct structure in your program that u can pass to the FM to get desired output.
    Thing to remember is that you first create   and then do save.
    1. Use following if input is from a *.txt  or any tab delimited file.
    INCLUDE com_product_const001.
    INCLUDE com_product_const003.
    *Excel data into Internal table
    PARAMETERS: p_infile  LIKE rlgrap-filename.
    DATA: gd_file type string.
    DATA:  prod type N.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
    productid TYPE COMT_PRODUCT_ID,
    product_desc TYPE COMT_PRSHTEXTX,
    proudct_type TYPE COMT_PRODUCT_TYPE,
    prod_categoryid TYPE COMT_CATEGORY_ID,
    prod_obj_family TYPE COMT_PRODUCT_OBJECT_FAMILY,
    prod_hierarchyid TYPE COMT_HIERARCHY_ID,
    maintenance_language TYPE SY-LANGU,
    prod_base_uom TYPE COMT_BASE_UNIT,
    sales org1
    sales org2
    item category
    END OF t_record.
    TYPES : Begin of struc_mat,
            HEADER  TYPE COMT_PRODUCT_MAINTAIN_API,
            DATA    TYPE COMT_PROD_MAT_MAINTAIN_API,
            INTERLINKAGES TYPE COMT_PRODUCT_IL_API,
            CONDITIONS TYPE COM_PRODUCT_CND_API,
            DOCUMENTS TYPE COMT_PRODUCT_DOCUMENTS_API,
          END of struc_mat.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
    wa_record TYPE t_record,
    ls_record TYPE t_record.
    **For Unicode check active in program attributes then need to declare constants as follows:
    **class cl_abap_char_utilities definition load.
    **constants:
       con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INFILE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_infile.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          DEF_FILENAME     = 'p_infile'
          DEF_PATH         = ' '
          MASK             = '*.txt'
          MODE             = '0'
          TITLE            = 'UPLOAD TAB DELIMITED FILE'(078)
        IMPORTING
          FILENAME         = p_infile
        RC               =
        EXCEPTIONS
          INV_WINSYS       = 1
          NO_BATCH         = 2
          SELECTION_CANCEL = 3
          SELECTION_ERROR  = 4
          OTHERS           = 5.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *START-OF-SELECTION
    START-OF-SELECTION.
      gd_file = p_infile.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                    = gd_file
      FILETYPE                      = 'ASC'
          HAS_FIELD_SEPARATOR         = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          DATA_TAB                   = it_record
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        write: 'Error' , sy-subrc .
        skip.
      ENDIF.
    END-OF-SELECTION.
    *!!! Text data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
    LOOP AT it_record INTO wa_record.
       WRITE:/     sy-vline,
       (10) wa_record-productid, sy-vline,
       (10)  wa_record-product_desc, sy-vline.
       (10) wa_record-age, sy-vline.
    ENDLOOP.
    *The field data in structure for MAT & FIN are very different . Loop at retreived data and based on product
    *type fill in the respective structure and proceed.
    *PARAMETERS: g_matnr1 TYPE comt_product_id.
    *PARAMETERS: gv_guid  AS CHECKBOX DEFAULT on.
      DATA :  gv_save  TYPE BOOLEAN VALUE 'X'.
      LOOP AT it_record INTO wa_record.
        IF wa_record-proudct_type EQ '01'.
          PERFORM init.
          PERFORM create USING wa_record.
          PERFORM save   USING gv_save.
        ELSE.
        ENDIF.
      ENDLOOP.
    2. Use excel file and use LSMW

Maybe you are looking for

  • How to install Adobe as a printer in control panel?

    I just changed computers. On my old computer, I was able to select Adobe in the printer list to save a document or excel file as a PDF file. However, on my new computer, I am not able to figure out how to get Adobe installed in the printer list. I'm

  • Zen Touch freezes even after full recha

    I have a 20gb Zen Touch that I have not used for the past few weeks(This is because of my new toy, my 30BG Zen Vision M). Figuring that the battery was discharged or something because of the lack of use, I recharged it fully. I turn it on and it gets

  • Reg: code problem in Function module

    Hi Friends, I am facing problem while developing Function module. i declared following things in Import. ""Local Interface: *"  IMPORTING *"     VALUE(SOURCETABLETXT) TYPE  STRING *"     VALUE(SELECTTXT) TYPE  STRING *"     VALUE(SOURCEINFOOBJECT) TY

  • HELP, Wireless Issues Very Strange!!

    I'll make this quick. I work in a home office for a church. We have 3 macs (2 ibooks, 1 pbook), and a junky PC running windows XP. We recently had an awesome new copy machine installed (Gestetner DSc-428). here's the issue... As soon as we plug in th

  • ISE and MAB descrisption

    Ciao, I not found a field for insert a description's  Mac Address. Is there a possibility in ISE to do this ? Iarno Pagliani