To calculate average of a measure for particular level of calendar hierarchy across all years

Hi All,
Let say Data is available for 10 years: from 2005 to 20015
Calendar Hierarchy: Year -> Quarter -> Month -> Week -> Day
Let say Measure Name is : SalesAmt
Now, I want to create a calculated measure for calculating: Average of SalesAmt for Calendar Hierarchy at particular level (for all the 10 years). Means, if somebody selects, Jan, 2014 it should show Average of all the January’s data (coming from all the 10
years like average of Jan -2000, Jan-2001, Jan-2002......Jan-2015), similarly if somebody selects 1st Quarter, 2012 it should show Average of all the 1st Quarter of all the 10 years (average of 1st quarter 2000, 1st Quarter 2002....1st Quarter 2015). 
Kindly suggest.
Thanks in advance.

You should use ParallelPeriod. Ex:
SELECT ParallelPeriod ([Date].[Calendar].[Calendar Quarter]
   , 3
   , [Date].[Calendar].[Month].[October 2003])
   ON 0
   FROM [Adventure Works

Similar Messages

  • How to create a custom measure for each level of a dimension

    Hi all!
    Can Anyone please explain me with an example, how to create a custom measure for each level for a dimension? I dont mine if you use
    one or more measures.
    thanks in advance
    hope someone helps me.

    For example:I create a dimension for product_dim witch has 4 levels:total, class, family and item:
    d_aben18
    n1_aben18
    n2_aben18
    n3_aben18
    n4_aben18
    herarchy:h_aben18
    cube:cubo_aben18
    measure:med_aben18
    I create this code to fetch the data to the dimension:
    TRAP ON CLEANUP
    SQL DECLARE c1 CURSOR FOR SELECT-
    total_product_id,1,'N1_ABEN18',total_product_dsc,-
    class_id,1,'N2_ABEN18',total_product_id,class_dsc,-
    family_id,1,'N3_ABEN18', class_id, family_dsc,-
    item_id,1,'N4_ABEN18',family_id,item_dsc-
    FROM PRODUCT_DIM
    "OPEN THE CURSOR
    SQL OPEN c1
    "FETCH THE DATA
    SQL FETCH c1 LOOP INTO-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N1_aben18_LEVELDEF,:D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N2_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N3_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N4_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    "SAVE THE CHANGES
    UPDATE
    COMMIT
    CLEANUP:
    SQL CLOSE c1
    SHOW 'KK2'
    Then I create a cube with use compression off, and in rules sum for example.
    After, I create a measure and I select Override the aggregation specification for the cube, in rules I put nonadditive and I would like to create aprogram to assign distinct values to each level of the dimension. For example, I put 1, 2 3, and 4 values, but at the end I would like to put count(distinct(values)).
    for that I create another program:
    VRB D_RETURN DECIMAL
    if D_ABEN18_N1_ABEN18_LEVELDEF eq 'N1_ABEN18'
    then D_RETURN = 1
    if D_ABEN18_N2_ABEN18_LEVELDEF eq 'N2_ABEN18'
    then D_RETURN = 2
    if D_ABEN18_N3_ABEN18_LEVELDEF eq 'N3_ABEN18'
    then D_RETURN = 3
    if D_ABEN18_N4_ABEN18_LEVELDEF eq 'N4_ABEN18'
    then D_RETURN = 4
    else d_return=26
    return d_return
    "SHOW D_RETURN
    cubo_aben18_med_aben18_stored=d_return
    but it doesnt work.I dont know how to put to assign or to see what I want.
    I report the measure, or I report the program, but then how can I see the values of the measure?
    thanks in advance

  • How to apply sorting for each level of a hierarchy?

    I'm using SSAS OLAP and I want to apply sorting of the levels of a hierarchy.
    I know that I can sort the whole hierarchy via ORDER function (I have some issues when I'm trying to apply DESC sorting
    on the whole hierarchy), but what I really want to achieve is sorting of a specific level. For example in the [Date].[Calendar] hierarchy (Adventure Works Cube), I want to have ASC sorting
    of years, DESC sorting of Quarter, ASC sorting
    of Months, etc. I do not want to break the hierarchy (using BASC or BDESC), I just need them sorted on the same level. Do you have an idea if this is possible at all?
    My idea is to sort the levels based on their key, not by the measure. For example if we have the following structure:
    -2009
     -Q1
       -Jan
       -Feb
     -Q2
       -May
       -June
    -2010
     -Q1
       -Jan
       -Feb
     -Q2
       -May
       -June
    I would like to be able to sort the data in the following order (DESC for years, ASC for Quarters, DESC for months):
    -2010
     -Q1
       -Feb
       -Jan
     -Q2
       -June
       -May
    -2009
     -Q1
       -Feb
       -Jan
     -Q2
       -June
       -May 
    Thanks in advance for your help!

    Hi Rosen,
    According to your description, you want to sort the different hierarchy members in different order, right? Generally SQL Server Analysis Services doesn't provide a way to sort dimension members in Descending order. SSAS provides only Ascending order. We
    can achieve this sort functionality by using a simple trick. However, the order is used for all the members of different hierarchy under this dimension. So I'm afraid that your requirement cannot be achieved. 
    Reference:Sort Dimension Members in DESCending order
    Thank you for your understanding.
    Regards,
    Charlie Liao
    TechNet Community Support

  • BEx Analyser: How can I define colours for different levels of a hierarchy?

    Hi everyone,
    I have a report in BEx Anaylser that includes a hiearchy of 9 levels.
    For a better overview, I want to define different colours for the cells of each level. In this way, the user should be able to see which numbers belong to which hierarchy level. How can I do this?
    Best regards
    Daniel

    Dear Anujit,
    Thanks for your answer.
    Seriously? I cannot do this with BEx Analyzer other than using Excel VBA macro?
    Cheers, Daniel

  • Function Module to get the node name in particular level name in Hierarchy

    Hi All,
    We have 0Material hierarchy which consists of 14 levels and materials are in the 14th level.
    We have a requirement to update the 4th level node name to all materials.
    So we have created the attribute to this 0Material and thought of updating in the transformation.
    Could you please suggest us to which function module i can in this scenario.
    Thanks in advance,..
    Prasanna

    Can you explain in more detail what exactly you want to do?
    do you want to limit hierarchy to level4?
    Regards
    Sudeep

  • Showing only a particular level from a hierarchy on a report

    Hi,
    I'm creating a crystal report on top of a BW Bex Query.
    In that BEx query I have a hierarchy on Profit Center with 6 levels, where the first level is the Area, the second one the Country, the third one is Plant, ...
    In my crystal report I only want to see the Areas in a table together with some key figures.
    If I use the Profit Center characteristic on the report, I get all values existing in the hierarchy, so not only the Areas, but also the countries, the plants, ...
    How can I manage to always see the Areas only?
    Lieven

    Lync 2010 doesn’t have the feature natively.
    With Lync Server 2010, by default, the contacts from federated domains are added as External Contacts.
    Lisa Zheng
    TechNet Community Support

  • How to calculate an average of YTD measures?

    Hi all,
    I'm working on BPC 10 for NW.
    We use an account-type dimension for Personnel inventory (Personnel to fixed-term contracts, to permanent contracts, number of executives, staff etc.).
    The corresponding ACCTYPE is AST because people are seen as a balance sheet account measure. So the measure, even if we're in periodic in our model, is stored as a YTD value.
    I want to calculate a average with those measures, for instance the average number of contractors from january to the current month, with a member formula. I can't manage to do that with a calculation because I can't add values of YTD measures: when I try a formula like ([ACCOUNT].A1 , [MEASURES].[YTD]) it returns the same value as the periodic value. Whereas the formula works with EXP account type.
    The formula I'd like to have in the end would be something like that:
    iif(isleaf([TIME].currentmember),avg(YTD(),([Measures].[PERIODIC],[ACCOUNT].[G102])),[TIME].currentmember.lastchild),solve_order=5
    This formula works in a previous version of BPC (5.1) but not in BPC 10.
    Any idea?
    Thanks very much,
    Sébastien.

    Assuming the job always starts at mid-might, you can try something like this:
    WITH t AS
    (SELECT to_date('01-JUL-2011 07:25:31', 'dd-mon-yyyy hh:mi:ss') AS end_date
    FROM dual
    UNION
    SELECT to_date('02-JUL-2011 07:10:58', 'dd-mon-yyyy hh:mi:ss') AS end_date
    FROM dual
    UNION
    SELECT to_date('01-AUG-2011 07:16:24', 'dd-mon-yyyy hh:mi:ss') AS end_date
    FROM dual)
    SELECT trunc(end_date, 'mon') AS MONTH,
            trunc(end_date, 'mon') + avg(end_date - TRUNC(end_date)) AS AVERAGE_TIME
    FROM t
    GROUP BY TRUNC(end_date, 'mon');

  • How can I derive Measures for coming periods like (Next Qtr – Measure)

    Hi All,
    How can I derive time series measures for coming periods just like Qtr Ago and Year Ago I want Next Qtr and Next Year columns in my fact, how can I achieve this?
    I have a report which talks about Actual recorded values to the projected values of current quarter , Ago Quarter , Next Quarter
    Ago Qtr | Current Qtr | Next Qtr
    xxx | xxxx |xxxxx
    yyy | yyy |yyyy
    Ago(measure, level, no of periods)
    Thanks,
    SMA
    Edited by: SMA on Sep 21, 2010 4:23 PM

    Hi All
    I have derived Next to Next Qtr starting date using the following formula
    TIMESTAMPADD( SQL_TSI_QUARTER , 3, TIMESTAMPADD( SQL_TSI_QUARTER , -(1), TIMESTAMPADD( SQL_TSI_DAY , -( EXTRACT( DAY_OF_QUARTER FROM "Business Intelligence"."Dso Date Dim"."Date")) + 1, "Business Intelligence"."Dso Date Dim"."Date")))
    Extracted quarter from the derived date as well
    EXTRACT( QUARTER_OF_YEAR FROM "Business Intelligence"."Dso Date Dim"."Next Qtr Start Date")
    However I could not create a measure for next quarter using Ago or ToDate functions in BMM of OBIEE
    Please let me know if any one worked on this before
    Thanks,
    SMA

  • Different chart for each level hierarchy in report designer

    Is there a way to display a different chart for each level of the hierarchy in a report designer? I want a different chart for each level. That is, if there are 5 nodes in level 4, I want 5 different nodes. Is there a way to do this? I tried to insert the chart inside a cell in each level, but it shows the same chart for all nodes instead of a different chart for each node.

    Has any one tried using a context sensitive chart?  According to this, it seems like this should be possible, but I am having no luck.
    http://help.sap.com/saphelp_nw70/helpdata/en/47/a99a0a5fdb0985e10000000a42189c/frameset.htm

  • ShoppingCart ProcessControlledWorkflow SRM 7.0 -BC set for N-level approval

    Hi experts,
    Which BC set I should activate for Shopping cart N-level approval Work Flow.?
    How to deactivate existing Active BC set in the system?
    Thanks

    Hello,
    Activation of BC set is to facilitate the faster & easier configuration. You have two options :
    1. Activation of new BC set will make the necessary changes. e.g if you have activated SC auto approval, run the BC set for 1 level approval, system will make all the changes required.
    2. Manually change the configuration based on your requirement. SRM - SRM Server - Cross Application Basic Setting - Business Workflow.
    BC sets are generic & might not fulfill all of your requirements. If your requirement is n -level approval, better to build your own expressions & process schema & levels. Take the reference of SAP delivered process levels.
    Hope this helps.
    Thanks
    Ashutosh

  • How to calculate Average balance for an account

    Hi,
    How to calculate average balance for an account for a particular period say for JAN-12 period and after the end of that period for another two days 01-feb-12 and 01-feb-12 ?
    I'm using the following query :
    SELECT cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6 "Account_XX",
    nvl(sum(l.accounted_dr - l.accounted_cr),0) "Balance"
    FROM gl_code_combinations cc,
    gl_je_lines l
    WHERE cc.code_combination_id = l.code_combination_id
    AND l.set_of_books_id ='XX'
    and code_combination_id = replace it with code combination_id for account_xx
    AND l.effective_date <= '31-Jan-12' (january period end ??)
    GROUP BY cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6
    There are some discrepancies in "average balance" after end of month (Jan-12)?
    How to calculate average balances for a particular account (Account_XX above)from end of month of Jan to first two days of february?
    Thanks,
    Kiran

    Kiran,
    Please let me know first, is Average Balancing feature enabled in your GL Ledger?
    Regards
    Muhammad Ayaz

  • How to calculate average if some of measure values are 0

    Hi
    I created a webI report on top of a Bex query, I have a more than 10 different measure in WebI report column on which i need to calculate average.
    If I  use the Average function provided with in WebI report it is calculating average for the measures which are having 0  values too, but i need to calculate average on a column only for those values which are not 0
    Ex:  Measure Quantity has values in the report like
    100
    100
    0
    100
    100
    Average function is calculating as 400/5
    but I need 400/4, because one of the value is 0, so i need to avoid that count which is zero and should divide it by 4 but not 5.
    One way is to custom create measure for all measures and make a if else condition and divided by that custom measure, but is there any other procedure?

    i hope this can help
    =Average([myMeasure]) Where ([myMesyre] <> 0)
    good luck
    Amr
    before the 0 add <> not Equal too sign < and >
    Edited by: Amr Salem on Jan 19, 2011 9:29 AM
    Edited by: Amr Salem on Jan 19, 2011 9:30 AM

  • I entered calculates hands and more than one account and used a credit card please raise security measure for Visa card and thank you

    I entered calculates hands and more than one account and used a credit card please raise security measure for Visa card and thank you

    Hi Eva B.,
    Please refer to the help document below:
    Adobe Store | Online order and payment FAQ
    Regards,
    Sheena

  • "Calculate Average" option for the Activity Usage Profile doesn't work

    I have the same problem as poster 793128 in a comment for a different thread: the "calculate average" profile option doesn't work for units (it works for cost though). I've used this option a lot on previous versions of Primavera but for some reason is not working on our new P6 release 7 (stand alone). As 793128’s post says: nothing happens, nothing changes, the profile keep showing totals, doesn't matter if the "base hours on time period" box is selected or if the divider is input by the user.
    The same option (calculate average / divide by) on the resource usage spreadsheet and on the tabular reports do work as expected so doesn't seem to be that I checked the wrong box for some user or administrator preference set up.
    Thank you for any help or clue. I posted this as a different thread because my original post was in a resource profile thread for a different issue that was already answered.

    *793365,*
    After reading your post I tested an older layout of mine that uses a similar setup and it still operates fine. On the "Resource Usage Profile Options" box under the "Graph" tab, I have "Calculate Average" checked and "24" entered in the "Divide interval totals by:" box.
    This allows my resource profile to display manhours per day for me.
    Some of my background info:
    I run in a multi-users platform and not in a stand alone setup.
    We have different resources loaded into the schedule with multiple calendars.
    I have several "Resource Filter/Group Names" setup for each separate resource on the "Data" tab too.
    Hope this helps,

  • Calculate average for some dates

    Hi,
    I would like to calculate average for some dates. Is there any function module or any process, please provide me.
    venkat.

    Use this FM HR_HK_DIFF_BT_2_DATES
    Example:
    DATA: DATE1 type P0001-BEGDA,
              DATE2 type P0001-BEGDA,
    YEARS type P0347-SCRYY,
    MONTHS type P0347-SCRMM,
    DAYS type P0347-SCRDD.
    DATE1 = '20070331'.
    DATE2= '20070101'.
    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
    EXPORTING
    DATE1 = date1
    DATE2 = date2
    OUTPUT_FORMAT = '03'
    IMPORTING
    YEARS = years
    MONTHS = months
    DAYS = days
    EXCEPTIONS
    INVALID_DATES_SPECIFIED = 1
    OTHERS = 2
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Joan

Maybe you are looking for

  • 5 Dataguard questions on implementation and maintainence

    I have created Oracle10g Dataguard Physical standby. Everything seems to working properly. I switch a log@primary and i see it applied at standby. In OEM the Primary instance is shown as "Primary" and Dataguard Normal. Questions ======= 1.I used cold

  • Is there any way I can work on a file created in Flash 9 in Flash 8?

    Is there any way to open a flash file created in Flash 9.0 CS3 with Flash 8? I have Flash 9 at work, but only Flash 8 at home, and I need to work on this project today. I can't download the trial version of 9 here either, because it doesn't seem to w

  • Problem with .sitx files (Safari but not Firefox???)

    Hi All, I have a website online (with help from iWeb and BBEdit) but am having a problem I cant figure out (this IS my first website!) I am hoping that someone much more knowledgeable than me can help me with it. I basically have a download section.

  • Presenter 9: "Change SWF loading text" not works

    Hello, everyone, I have just bought Adobe Presenter 9 to transfer PPT to e-Learning course file. When I try to change SWF loading text, I modify the presentation's vconfig.xml file by adding:    <uitext name="ADOBE_PRESENTER" value="Welcome to our tr

  • MessageSecurityException in SOAP Adapter using WebServiceSecurity

    Hi all, hopefully,someone can help me. In my scenario I send signed and encrypted messages via SOAP from XI to another one. After testing, I get the following error: SOAP: response message contains an error XIServer/UNKNOWN/RecoverableException - com