How to calculate average for a keyfigure based on 0calmonth.

Hi Experts,
I have a requirement in SAP BI  is as below.
I have 2 colums in my query  1. 0calmonth ( charactersic) 2. PERDAY TARGET(KF)
Now I want to create a new column t.e.  "AVERAGE  YTD TARGET" for" PERDAY TARGET" based on "0CALMONTH"
Like, I have 10 records in one month (APRIL) and another month (MAY) having 25 records.
SO I want to display "AVERAGE YTD TARGET " for each record in Report .
so,please let me know the procedure to complete this in BEX query.
Thanks in advance.
Regards,
Surendra babu

Hi,
Please go through this pdf if you want to know how exception aggrgation works.It will be really helpful for you.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0b8ed5b-1025-2d10-b193-839cfdf7362a?quicklink=index&overridelayout=true
Regards,
AL

Similar Messages

  • 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 calculates averages and send to a file?(source code)

    how to calculates averages and send to a file?(source code) I need to get started but I don't know where to begin...........the book I have doesn't really say how to handle averages and send to a file.................anybody got suggestions on how to get started? I am a newbie so place in layman's terms.............thanx

    To calculate an average: add all of the numbers together and divide by how many numbers you added together.
    ex: (1 + 2 + 3 + 10)/4 = 4 (4 is the average)
    As for writing them to a file, look over the API for random or sequential access files.

  • 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

  • How to calculate Average of Keyfigure

    Hi Gurus,
    I have a requirement where I have to calculate average of key figure value for 1 material.
    I tried using 'Average' in exception Aggregation but it just sums up everything.
    Can anyone please explain?
    Thanks

    Hi
    1. Include the key figure you want to average into the columns; call it KF1
    2. Create a Formula; call it CTR1, and in the detail view put a 1. (This 1-value is not used except to avoid an error in the formula syntax checker.) On the Aggregation tab, choose Exception Aggregation: Counter for all Detailed Values, and for the Ref. Characteristic, choose the same characteristic as the lowest level characteristic in the initial view of the output. E.g. if you only have 0CALMONTH in the output, choose 0CALMONTH. When you run this, the total at the bottom of this column should be equal to the number of rows in that column. Note that we use Exception Aggregation here so that the total at the bottom is calculated before the output is generated and is available to other formulas in the query design; if we were to use the Calculation tab it would look the same to us in that the total would appear at the bottom, but the calculation would occur too late for us to use within the query.
    3. Create a second formula, call it AVG1. The formula will be:
    SUMGT KF1 / SUMGT CTR1
    SUMGT accesses the Overall Result value at the bottom of the KF1 and CTR1 columns. You can find the SUMGT function in the Data Functions folder - turn on technical names first; the description is Overall Result. You could instead use SUMRT; the difference is that SUMGT will use the filters applied in the filter block; SUMRT will ignore them.
    3. Run the query. You should see the Average in every cell in the Average column. You can use this formula as input to another formula, or just use ( SUMGT KF1 / SUMGT CTR1 ) within a formula to access the average value.
    Thanks

  • How to find average for non blank values

    I need to calculate avarage for each restricted key figures. There are some blank values in this restricted key figures. Now I need to sumup and divide by non blank count. Do you know how to do it? How to count non blnak values and find avereage.
    Thanks,
    Phani

    In the properties of Key figure used in column/row, Calculations section, you can maintain calculation type for result as well as single value. There is "Average of all values not equal 0" option is available.
    Rgds,
    Vikram.
    Edited by: Vikram Kate on May 22, 2008 11:23 AM

  • How to calculate Average time from a date field

    Hi All,
    I have a date type field in my table .
    I want to calculate average time for a given country in a select query. Date has to be exculded. Only time has to be taken into consideration.
    Kindly help me.
    Sample data
    india 25-JUN-09 08:12:45
    india 25-JUN-09 09:01:12

    Take which one you want.WITH dates AS
      (SELECT sysdate x FROM dual
        UNION
       SELECT sysdate + 1 +1/24 FROM dual
    SELECT TO_CHAR(to_date(AVG(to_number(TO_CHAR(to_date(TO_CHAR(x,'HH24:MI:SS'),'HH24:MI:SS'),'sssss'))),'sssss'),'hh24:mi:ss')
       FROM dates;
    WITH dates AS
      (SELECT sysdate x FROM dual
        UNION
       SELECT sysdate + 1 +1/24 FROM dual
    SELECT floor(24 * AVG(x- TRUNC(x)))
      || ':'
      || floor(mod(24 * AVG(x- TRUNC(x)),1) * 60)
      || ':'
      || floor(mod(mod(24 * AVG(x- TRUNC(x)),1) * 60,1) * 60)
       FROM dates;By
    Vamsi

  • 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

  • How to calculate average not through basic formula

    Can any bodytell me how to calculate averge of 96 rows in the quey designer  not by hard coding them.
    Is there any formula for creating it through formula or through calculations .
    And also how to calculate the maximum value and minimum value of the entire 96 rows  which is picking from a Z table -ZDC_2100.
    Iam having time blocks of 96 for 24 hrs each of  15Min.

    Hi,
    You can achieve using a counter at baselevel and use exception aggregation at query level...
    Also check the below links might be useful:
    http://help.sap.com/saphelp_nw04/helpdata/en/75/21054da1392649948e5b94e4fc4bce/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/e0173f5ff48443e10000000a114084/frameset.htm
    Hope this helps.......
    Rgs,
    I.Ravikanth

  • How to calculate average in result in BEx

    Hi Expert,
    I have 2 fields one is project and another # of days to finished project (I used formula to calculate the # of days from start to finished date. NOw in result need to calculate average of days took to finished all projects.
    I belive formula will be ( # of days / projects) but how we can apply in query. If anyone know please help out I really appericiate.

    Hi,
    Right click on your formula and go to properties, there you have the options as "Calculate Result as" and "calculate single value as" from the drop down box you can select option as "Average".
    Regards,
    Durgesh.

  • How to calculate total for field for particular day. in smart forms

    hi,
             pls help in this problem,
    how to calculate cumulative totals for the particular field in samrtforms

    Hi ,
    Either you can calculate the sum in driver program with
    Loop at where Condition .
    Sum the required field .
    endloop .
    Then pass it to smartforms
    Or
    Double Click on table node .
    In the conditions tab give the required condition .
    select calculation tab.
    In operation select Total , in field name give the name of the field you want to sum
    and in targer field name specify the name of the field that should contain the result .
    To convert the total in to words use the function module in program lines
    CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
    EXPORTING
    amt_in_num = w_total
    IMPORTING
    AMT_IN_WORDS = w_total_words
    EXCEPTIONS
    DATA_TYPE_MISMATCH = 1
    OTHERS = 2
    Regards

  • How can calculate Bandwidth for ACS packet

    Dear All !
    My network : AS5400 at remote site sent ACS information (only VoIP Accounting information: CDR-Call detail record) to Center site via IP WAN link (512k).
    How can I know how much Bandwidth need for ACS packets/ 1 call ?
    Anyone help me some idea to calculate this BW
    Thansk so much

    Hi ,
    There are many bandwidth monitor available that you can set up on acs sever. This will give you idea how much traffic is received by acs during the particular call.
    Also you can try sniffing acs port to get an rough idea about the traffic generated.
    Regards,
    ~JG

  • How to calculate averages and send to a file?(source code)

    Having trouble the book isn't very clear on how to use averages.............could some give me an example of a program..................that gets averages and send to a file..........?

    From Deitel and Deitels monster 'How to Program' :
    import javax.swing.JOptionPane;
    public class Average {
    public static void main ( String args[] )
    int total, gradeCounter, gradeValue, average;
    Swing grade;
    total = 0;
    gradeCounter = 1;
    while ( gradeCounter <= 10 ) {      //assuming 10 values
    grade = JOption.showInputDialog ( "Enter grade: " ) ;
    gradeValue = Integer.parseInt ( grade );
    total += gradeValue;
    gradeCounter = gradeCounter + 1;
    average = total / 10;
    JOptionPane.showMessageDialog (
    null, "Class Average is" + average, "Class Average",
    JOptionPane.INFORMATIOIN_MESSAGE );
    System.exit ( 0 );
    Import package java.io
    Three stream objects are created when you execute , System.in, System.out, System.err
    System.out can be directed to send it's output to a file or disk.

  • How to get two Results  - Sum and Average for one KeyFigure

    I have "Material" in Rows and "Cal Year/Month" in Columns and also KeyFigure "Qty" in Columns.
    The Results (Yellow) of "Qty" is defined as "Avg of all values <>0". This works fine but how do I get two Results - one is a "Sum" and the other "Avg" for just one KeyFigure. The output basically should look like below:
          Cal Yr/Month  01/2006   02/2006   03/2006...    Result        Result
    Material                   Qty       Qty           Qty       Sum of Qty   Avg of Qty
    ABC                       100         0             200            300             150     
    DEF                       100         200          300            600             200     
    GHI                        500         300          400           1200            400

    Hi Srinivas,
    I think you must use Restricted Key Figures and Formula.
    Do not introduce CALMONTH in columns, but restrict 12 times the Key Figure Qty with 0CALMONTH3, that is 01-02-03-...
    Then create a Formula that is the Sum of all Restricted KF and call it SUM.
    Then copy the previous Formula (SUM) and call it AVG and give the option of Average of all Values <>0.
    Try.
    Ciao.
    Riccardo.

  • How to calculate average value?

    Hi all,
    I'm using Lumira 1.15. I'm doing some practices with the sample dataset BestRunCorp... I want to calculate the average value of gross margin which is grouped by lines so that I can use a line chart to show the difference between the gross margin value and average value.
    How can I achieve this ?
    Best regards,
    Shuang

    It looks like it calculates the average based on the dimension
    See below:
    If you take the "Best run" Excel file, sort by country, calculate the average in Excel, it matches Lumira's 4,056 (for Argentina)
    I am not sure I follow your divide by 12 logic?

Maybe you are looking for