Hoe to calculate "average YTD target"

Hi Experts,
I have a requirement in Bex report .
the data will be like as follows...
0calmonth  empnumber      empname   perday-target       AvGYTD-target
04.2011     2                     abc1     100                      100
04.2011     3                    abc2     200             200
04.2011     4                    abc3     300            300
04.2011     5                    abc4     400            400
05.2011     2                   abc1     500            300   for reference  ( 500+100 /2) based on empnumber
05.2011     3                   abc2     600            400   for reference  ( 600+200 /2)
05.2011     4                   abc3     700            500   for reference  ( 700+300 /2)
05.2011     5                   abc4     100                      250   for reference  ( 100+400 /2)
06.2011     2                   abc1     600            400       ( 600500100/3)
06.2011     3                   abc2     700            500       ( 700600200/3)
06.2011     4                   abc3     800            600       ( 800700300/3)
06.2011     5                   abc4     100                       200       ( 100100400/3)
As above I need to display the column for "AVGytd_target"( Like last column  in above table).
can anybody give some suggestions to complete this task.
Thanks in advance,
Regards,
babu.

Hi Ajay,
i need the data like 5 th column only   .
"AvGYTD-target"
100
200
300
400
300  
400       
500 
250
400     
500
600       
200           
and  not  below data. ( Its for your reference)
for reference  ( 500+100 /2) based on empnumber
for reference  ( 600+200 /2)
or reference  ( 700+300 /2)
for reference  ( 100+400 /2)
( 600500100/3)
( 700600200/3)
( 800700300/3)
( 100100400/3)
Thanks in advance,
babu.

Similar Messages

  • Customer exit code to calculate  Average YTD.

    Hi Experts,
    I want to create new column ( AVGYTD TRGT) in Bex report for folling data .( Which is FF data).
    I have created one formula variable(zfmvavgytd) of type customer exit. and strucked at coding part.
    so that, anybody provide customer exit code for required column(avgytd trgt). and details are as follows.
    0CALMONTH  ENO  ENAME  PERDAY_ TRGT  
    04.2011             1     ABC             100                     
    04.2011             2     BCD             200
    05.2011             1     ABC             200 
    05.2011             2     BCD             200 
    06.2011             1     ABC             300 
    06.2011             2     BCD             200 
    07.2011             1     ABC             200
    07.2011             2     BCD             200 
    till  03.2012        
    Now I want to display the column for ( AVG YTD_TRGT)   based on "0calmonth " & " ENo  "   as below
    AVG YTD_TRGT
    100           
    200
    150
    200
    200
    200
    200
    200
    calculation behind this is...
    for 04 .2011   --empno(1)  ---100/1
    for 04 .2011   --empno(2)  ---200/1
    for 05 .2011   --empno(1)  ---200+100/2
    for 05 .2011   --empno(1)  ---200+200/2
    for 06 .2011   --empno(1)  ---300200100/3
    for 06 .2011   --empno(1)  ---200200200/3
    for 07 .2011   --empno(1)  ---200300200+100/4
    for 07 .2011   --empno(1)  ---200200200+200/4

    First you need to calcualte the YTD and then Average YTD.
    Year to Date (YTD) u2013 From the 1st to entered u201CKey Dateu201D for the current year.
    Average Year to Date - YTD divided by the u201CNo of Daysu201D in year till u201CKey Dateu201D for current year.
    Check the below code for getting Previous YTD....next create a Selection restrict the KF with YTD varaible
    Below is sample code for reference.
    to calculate "Previous year to date" (User input Calday u2013 key date)
    WHEN 'ZDAYPYR'.
    IF I_STEP = 2. "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZPDATE'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
    L_S_RANGE-LOW(4) = L_S_RANGE-LOW(4) - 1. "low value previos year
    v_loc_date = L_S_RANGE-LOW. "take input value in another variable
    L_S_RANGE-LOW+4(4) = '0101'.
    L_S_RANGE-HIGH = v_loc_date. "high value = input, taken into another variable
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.

  • 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

  • Rule to Calculate Average

    I need help writing a rule to calculate average units. I know the HFM admin documentation contains an Average Function, but my calculation needs to be a little different. I need to dynamically calculate average units based on the POV. Also, I need to always use "Beginning Units" in my calculation. I've listed some examples below...
    1.) Periodic AvgUnits for May 2008 = (Apr 08 Units + May 08 Units) / 2
    2.) QTD AvgUnits for May 2008 = (Mar 08 Units + Apr 08 Units + May 08 Units) / 3
    3.) YTD AvgUnits for May 2008 = (Dec 07 Units + Jan 08 Units + Feb 08 Units + Mar 08 Units + Apr 08 Units + May 08 Units) / 6
    Does anyone have any sugestions?
    Thanks,
    Clint

    You need to use 3 different formulas here are some examples, you can derive the quarterly from this two:
    Function Avg2(Acct)
    Avg2 = "(" & Acct & " + " & Acct & ".P#Prior) / 2"
    End Function
    Function AccumYTD(Acct,pov_period)
    AccumYTD = "(" & Acct
    Select Case pov_period
    Case 1
    AccumYTD = AccumYTD & " ) "
    Case 2
    AccumYTD = AccumYTD & " + " & Acct & ".P#CUR-1 ) "
    Case else
    For PastMonth = 1 to pov_period - 1
    AccumYTD = AccumYTD & " + " & Acct & ".P#CUR-" & PastMonth
    Next ' PastMonth
    AccumYTD = AccumYTD & " ) "
    End Select ' Case pov_period
    End Function

  • 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 do I calculate averages in a form?

    Hi All,
    I'm throwing myself on the mercy of the forum.
    I'm new to form building and I don't know javascript.
    I'm working on a form and I can't seem to get it right.
    When I first enter values it seems to be working, but if I make corrections or changes the calculations go bad.
    I'm sure there is an easier/better way to calculate averages in a form.
    I think I need either a calculate/re-calculate button, or better javascript that processes the math line by line.
    I'm getting too close to the deadline to keep futzing around with it.
    Would anyone care to have a look at my form and help me?
    Here are the details...
    I'm using Acrobat 9 Pro
    I, and the administrators, are using Adobe Reader X. (10.1.4)
    I'm using a Macintosh running OS X (10.7.4, Lion)
    Teacher Evaluation Form:
    Teachers demonstrate proficiency in four domains.
    Evaluators assign scores (-, N, 0, 1, 2, and 3) to a number of items in each domain.
    N indicates the item is Not Applicable.
    A dash - indicates a score hasn't been given yet.
    Each domain has a weight value to be calculated into the final score.
    My job is to create a form that calculates the raw average and the weighted score for each domain, then a total for the performance evaluation total.
    What I did.
    I created:
    A drop down field to score each item under each domain.
    A hidden field that decides if the field for each item has a true number or another character.
    A hidden field that sums the scores of all the items in each domain.
    A hidden field that sums the number of fields that have a numeric value.
    A field that divides the total of the values from each domain and divides it by the number of of fields with numeric values to get the raw average.
    A field that multiplies the raw average by the appropriate amount to get the weighted score for each domain.
    Finally, a field that sums the weighted scores to produce the final evaluation total.
    Again, it seems to work at first, but if any changes are made to the scores the math goes bad.
    Here is a download of the form with all the hidden fields visible so you can see what is happening.
    https://dl.dropbox.com/u/783012/2_Evaluation%20Form.pdf
    Please help me!

    There are several problems with the calculation script for the "Test Total" field. Be sure to have the following user preference set: Edit > Preferences > JavaScript > Show console on errors and messages.
    Also check that the field calculation order is correct.

  • PDF Form Field calculates AVERAGE incorrectly

    I have a PDF Form field that is set to calculate the AVERAGE of 4 other fields. Each of those other fields has its validation set to allow only the values 1 through 3.
    The Average field is dividing the total by 4 even if a person only fills out 2 of the fields. I thought AVERAGE would only count the fields that have a value in them. But it's seeing the ones that are blank as containing a 0, even though that is an invalid value for that field.
    How can I fix this? The customer really wants the option of having up to 4 fields and wants an average of just the ones that are filled in. I thought that was what Average was supposed to do.
    Is there a way to tell Acrobat to ignore the fields if their value is less than 1?

    I responded to this question here: http://answers.acrobatusers.com/PDF-Form-Field-calculates-AVERAGE-incorrectly-q13211.aspx

  • "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,

  • 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

  • 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 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 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.

  • Can we calculate Average in VC

    Hi,
    Can we calculate average of all values of one data field itself, in VC.
    I had a keyfigure Quantity, now i need to display Avg of all Quantity according to calendar month.
    is this is possible in VC?
    Thanks
    Tulsi

    Hi
    yse you can do it using Aggreagate operator i.e Sigma Operator
    Drag the sigma operator from compose panel and it to the data service output port and set your settings
    Regards,
    Govindu

Maybe you are looking for