MDX - Average of months values for quarters, semesters and years

Hello,
I would like to aggregate month values in MDX query to get quarter, semester and year ones.
The problem is that "SUM" is used by default, but I want the "average" for quarter, semester and year values.
Example (AVG columns are expected, not SUM ones) :
Year
Month
Value
sum Q
avg Q
sum S
avg S
sum Y
avg Y
2011
1
130,71
416,58
138,86
843,66
140,61
1499,33
136,30
2011
2
146,71
2011
3
139,15
2011
4
133,51
427,08
142,36
2011
5
147,14
2011
6
146,43
2011
7
128,58
373,59
124,53
655,67
131,13
2011
8
109,98
2011
9
135,03
2011
10
135,83
282,09
141,04
2011
11
146,27
2011
12
NULL
Thanks for help.

Hi Unkedeuxke,
As Ken said, we do not have a measure Average aggregation type in SQL Server Analysis Services. We do have AverageOfChildren (or Average over time), however it is semi-additive and works only along a Time dimension. Fortunately, we have Sum and Count, and
since Average = Sum / Count, we can build our own Average aggregation when we need one. Here is a blog about how to create a average measure, please refer to the link below.
Average Aggregation in Analysis Services
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • How to get the current month value for a customer exit variable?

    How to get the current month value for a customer exit variable? 
    And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
    Thanks!

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    Regards,
    Vijay.

  • How to Bring the Quarter Period and Previous Month Value for given Input

    Hi to all,
          I want bring Quarter Period and Previous Month value for the given Input. Plz help me on this
    Example :
    Input : 06.2008
    Output:
    Input     Prev.Month  Quarter 1   Quarter 2   Quarter 3 
    06.2008  05.2008      03.2008     12.2007     09.2008
    12.2008  11.2008      09.2008      06.2008    03.2008
      Is there any Standad Exit for this or we have to write coding ?
    Regards,
    Saran

    Hi,
    You can solve this by using Replacement path.There you have a option offsets.Here give the current period.Based on that give the number which previouse month you suppose to want.
    I think this 'll help you
    assign points if this helps
    Regards
    JT Goud

  • How to fetch year till date value for earning for current ,last and year

    hi,
    how to fetch year till date value for earning for current ,last and year before that from payroll result
    plz reply soon,
    pratyush

    Dear Pratyush,
    Pick this from CRT.
    Use LDB PNPCE & Fire event GET PAYROLL &
    then you can pick from CRT.
    Hope this helps.
    Kindly reward in case useful.
    Regards & Thanks,
    Darshan Mulmule

  • Account Creation - Badi for Default values for BP Role and Sales Area

    Hi all,
    my requirement regards the possibility to create a new prospect (a link should be available in the navigation bar or create section).
    Logically, a bp role as "Prospect" and particoular sales area should be created automatically.
    I created an implementation for the BADI definition "BADI_CRM_BP_UIU_DEFAULTS". But don't know how to create the default values for BP role and Sales area:
    In my code
    assign cr_me->('VIEW') to <lv_view_name>.
      if sy-subrc ne 0.
        exit.
      endif.
      lv_viewname = <lv_view_name>.
      case lv_viewname.
        when 'AccountDetails.htm'.
    I obtain the viewname "AccountDetails" , the related context "Header". After I don't know how to proceed to obtain the related entities through the relationship BuilRolesRel and BuilSalesArrangementRel.
    Am I following the right way? Is there another solution to prepare the output for default values?
    Any kind of suggestion will be appreciated.
    Regards, Roberto

    go to spro>cross-application components>sap busines partner>business partner> basic settings>field groupings>Configure Field Attributes per BP Role
    Double click the business role which you want to customaze (e.g. 'A') and change the proper settings.
    Regards.

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • I just purchased a month to month subscription for Acrobat Pro and I am getting an error when I try to download the software.

    I just purchased a month to month subscription for Acrobat Pro and I am getting an error when I try to download the software. after about 50% of the way, it just crashes.
    Thank you,
    JTF

    I am having the same problem - the install crashes around 40%. 
    I am using MAC OS 10.10.2 and purchased Acrobat Pro monthly subscription.  The error message is: 
    'Acrobat installer has encountered an unexpected failure.  Please try again.  If it continues to fail, contact Adobe support.'
    I have tried several times but keep getting the same error message.  Any ideas?
    Thanks,
    Cindy

  • Yesterday Adobe Helpdesk gave me a link to manually update my monthly paid for Photoshop CC and now I am getting 00 day trial version expiration warnings, but I paid already for 5 months. How fix this today?

    Yesterday Adobe Helpdesk gave me a link to manually update my monthly paid for Photoshop CC and now I am getting 00 day trial version expiration warnings, but I paid already for 5 months. How fix this today?

    ps: on Thursday there was a automatic windows 8.1 update before shutting down the pc and in friday the photoshop CC monthly paid for since huly 19, did not download the available update. Via helpdesk I got a link to manually update the photoshop CC but today I get a warning that the photoshop CC has 00 days left in trail....whereas I have been paying and using it for 5 months already and helpdesk chat is closed today on saturday.

  • System generated value for a field and incrementing (using module pool pro)

    Hi,
    I'm getting system generated value for a field and incrementing (i.e done by coding) when i'm saving the screen or transaction (which is created using module pool programming) while modifying, saving its working fine, but when i'm going out of the screen or exit n again i start the screen (with some ztransco) the value for the field again starting from 0 so i want to start from the same value for a field where we exit or got out from the screen n incremented respectively while saving the screen,
    Thanks & Regards,
    MS
    Edited by: Rob Burbank on May 4, 2010 10:40 AM

    Search the forum for number range objects.
    Rob

  • Last Month value for the keyfigure in Report

    HI ALL,
    how do we get keyfigure value for the last month in the report.
    for ex:  for  amount keyfigure should come for the last month  rest of the key figures should come for the current month values.
    SBU |    AMOUNT (LAST MONTH VALUE) |      QTY(CURRENT MONTH) |     NETPROFIT(CURRENT MONTH)
    The above shown is ex as i required in same manner. Even i restricted with calmonth offset value -1 in keyfigure but it is not working. please help me to get solution .
    Thanks
    Pinky Reddy

    Hi Pinky,
    It is not advisable to use offset to get the previous month value.This is not effective in the case when your current month is Jan & u have to get the previous year's dec month value.It is always better to opt for Exits
    Do use the code mentioned below.
    Note:- ZCUSMFIS3 - Variable in the selection screen for entering current month
               'ZPREVPER - Variable with which the amount key figure has to be resticted.
      WHEN 'ZPREVPER'.
        IF I_STEP = 2. "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                                  WHERE VNAM = 'ZCUSMFIS3'.              
            V_PERIOD = LOC_VAR_RANGE-LOW+4(3).
            V_FYEAR = LOC_VAR_RANGE-LOW+0(4).
            V_FVARIANT = 'B1'.
            V_FISCPERYEAR = LOC_VAR_RANGE-LOW.
            IF V_PERIOD = '001'.
              V_PERIOD = '012'.
              V_FYEAR = V_FYEAR - 1.
              CONCATENATE V_FYEAR V_PERIOD INTO V_FISCPERYEAR.
            ELSE.
              V_FISCPERYEAR = V_FISCPERYEAR - 1.
              LOC_VAR_RANGE-LOW = V_FISCPERYEAR.
            ENDIF.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW = LOC_VAR_RANGE-LOW. "YYYYMMDD - DD will indicate the no of days
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
    Hope this provides the solution for your requirement.
    Regards,
    Saswati.

  • Average of all values between (first above and last above) a threshold value.

    Currently I have a VI which I programmed a year or more ago, which grabs any value out of a data set that is above a threshold value. This is used for capturing the average of all values over a threshold when there is one peak of values that go above that threshold. However, when there are two or more peaks that go above this threshold, only the values above that value are averaged, so the end result is the average of two or more averages.
    What I need is for every value that occurs after the threshold is reached and before the threshold is dropped below for the last time. Picturing a set of data whose graph looks like the letter "M," for example with the threshold being halfway up the M, I want to show the average of (the first hump, plus the dip below the humps, plus the last hump) but what I'm getting now is the average of (the first hump, plus the last hump). What I get now cuts out the data between the two peaks.
    Any assistance would of course be appreciated.
    Solved!
    Go to Solution.
    Attachments:
    AveAboveThresholdAll.vi ‏15 KB

    Actually I think that Tims solution has a little difference to the stated problem that both limits should be above a threshold value. Since the second array is inverted the rounding should be not towards +Infinity but towards -Infinity in order to really only go up to the last element that is above the threshold. The code as made by Tim takes one sample more, which could or couldn't have any significance.
    Nevermind, I take that back.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to get lookup value for a lookup_type and pass as a parameter in OAF

    Hi,
    I have requirement wherein I have to enable the "Add Attachment" Button only for a particular deliverable name.
    Steps I followed
    1) I have extended the corresponding Controller class.
    2) Sting str1="XYZ";
    3) Getting the attachment table bean and the deliverable name thru Data Mappings as Attachment is the built-in funtionality in OAF.
    4)Checking if the deliverable name whether it is equal to str1 or not
    Case1: If the deliverable name is not equal to str1 then I am placing the insertallowed as BOOLEAN.FALSE
    Case2:If not it will be enabled.
    5)The functionality as per the requirement is working fine.
    6)Here for str1 I have hardcoded the value initially but I need to take up the value from a lookup created for this value because may be in future if for more than one value the "Add Attachment" Button has to enabled they it will be easy to add in the look up only. No need to change the controller class.
    7) So please let me know the steps in getting the value from a lookup and have to pass the lookup values (Here str1--"XYZ","ABC","DEF") into the extended Controller Class.
    Thanks in Advance,
    Regards,
    Ramya

    Ramya,
    Here for str1 I have hardcoded the value initially but I need to take up the value from a lookup created for this value because may be in future if for more than one value the "Add Attachment" Button has to enabled they it will be easy to add in the look up only. No need to change the controller class.For this u need to iterate through the lookup values.
    Share ur existing Controller Code.
    Regards,
    Gyan

  • How to use the same variable value for data entry and the planning sequence

    Hi,
    the scenario is the following:
    Using the WAD template a user enters cost center plan data. The cost center is selected by the chosen value for the variable "V1".
    Afterwards he shall push a button which starts a planning sequence (including saving the data and further functions). This planning sequence uses a filter that also contains the variable "V1".
    What or where has it to be defined that the planning sequence uses automatically the same value for the variable "V1" as selected for the data entry?

    You have to define in the planning function. The planning sequence is only a sequence and it read the planning functions underneath it.
    Ravi Thothadri

  • HT1515 Is there a monthly bill for airport express and extreme?

    I am thinking about buying a airport express but would ike to know if I will have to pay a monthly bill for it or not

    Well, in order to use the devices for internet access, you need an ISP (internet service provider) - either cable, DSL or whatever is available in your area.  That provider is going to charge a fee for internet access.  Other than that, no there is no inherent fee in using  the equipment (eg. as long as you do not need internet connectivity, and just wanted an in-home wireless connection between your own devices, you could use them entirely for free, other then the electricity used to power them).

  • Memo Value for Main Asset and Sub Asset

    Dear Experts,
    I am having the requirement that, all the main asset should have the memo value Rs 1.
    For this I have specified the memo value in OAYI. But system is taking the memo value for Main asset as well as Sub asset.
    But we don't want to keep the memo value for sub asset.
    I hope, I am missing some settings. Could anyone please help me to solve this.
    Regards,
    Aswin

    Hi:
           You need to review your copy settings for sub assets for your relevant class's screen layout in  SPRO...Financial Accounting,,,,Asset Accounting....Master data....Define Screen Layout for Asset Master Data....Select the screen layout which has been assigned to your asset class in OAOA. You will not find any field for value copied. So it is not possible to avoid this happening becuase it is done a t CO code level.
    Regards

Maybe you are looking for

  • Adapter Module Vs Function Module

    We are creating a Adapter Module to process an Incoming File. The File contains the Material Master data. But there are many records are invalid due to various reasons. We need to strip the badrecords. There are around 650 fields in each record and t

  • Yosemite/FileVault - data lost?

    device Macbook pro retina 2012 osx Yosemite filevault enabled story upgraded to yosemite, enabled filevault after reaching desktop I would get spinning beachball after 5-10 seconds. Guest account worked fine. Reinstalled Yosemite from recovery mode a

  • Anyone knows a DVD player for TV which can play QuickTime movies /FCP movie

    I am trying to find a DVD player for my television which can play a QuickTime or Final Cut Pro movie which is on a DVD. Do you know one ? I have a FCP movie (720 x 576 ) transfed to a DVD ( UDF format ). I have tryed to play the DVD in many DVD plyer

  • Call Screen problem in a report

    Hi All, I have a report in which I am calling an ALV grid screen 1000. I select some line items and click on execute. On execution in the PAI I have called a function module which has a call screen statement inside it. This should call the screen 100

  • Another conditions question

    Hey All, Can anyone tell me the correct syntax to build the following where clause in a condition statement? I am trying to emulate WHERE QryGroup1 = y OR QryGroup2 = y against the BP table in a choose from list. I used the same syntax as the example