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

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

  • Logic to calculate average number of employees per day...

    Hi,
    In an internal table, i have employee number, start date, end date.
    This table shows employee's start and end dates for a cost center.
    Now, the requirement is to calculate the average number of employees available per day for a given period...
    Lets asume that we would like to calculate average number of employees per day for a given period of 30 days (01.01..2009 to 30.01.2009)....
    The above table will have around 20 employees with their start and end date.
    Among these 20, some may be present between 1st to 10th Jan only..
    In such case, How to calculate average number of employees per day in such case?
    Can anyone help me out with a rough sketch of logic for this calculation?
    Thanks in Advance,
    Pavan

    My Logic:
    1) First choose dates from which date to which date you are planning to calculate. [Here i am trying to calculate from Jan 1st 2008 to till date - March 3rd 2009 = So total days = 427 days]
    2) First try to count number of days worked in organization by each employee. [Lets take employee a = 10 days, b = 182 days, c = 427 days].
    3) Then total all the number of days. [abc = 10182427 = 619 days].
    4) Total number days / Total number of days worked = 619 / 427 =  1.44 employees per day.
    Employee     Emp-Start Date     Emp-End Date     No. of days
    a             Jan 1st 2008     Jan 10th 2008     10
    b             Jun 1st 2008     Jun 30th 2008     182
    c            Jan 1st  2008     3rd March 2009     427
              Total No. of days                     619
         From Jan1st 2008 to Till date 3rd March 09          427
              619 / 427 =     1.449648712
    I tried take simple example to recheck the above scenario is correct or not. If 'n' number of employees worked for an organization in a year (365 days) is 730. then per day = 730 / 365 = 2 employees per day worked for organization.
    I am not sure my logic is correct or not ... just tried like above.
    Regards,
    ~Satya

  • How the LMS 4.2 calculate average interface Utilization

    Hello!
    I have interface Tunnel1 with bandwidth 5000.
    How the LMS 4.2 calculate average interface RxUtilization or TxUtilization on this interface?

    Hi ,
    Below is how LMS calculates this value:
    RxUtilization = (ifInOctets*8*100)/ifSpeed   
    TxUtilization = (ifOutOctets*8*100)/ifSpeed
    Thanks-
    Afroz
    ***Ratings Encourages Contributors ***

  • To calculate average for a currency field in alv

    Hi,
    I have a requirement in which i need to find the average of a currency field in alv. For the particular field, i'm passing the value of DO_SUM = 'C' in thr field catalog(as suggested in many threads); but I'm not able to calculate the average. it still shows me summation when i click on summation button.
    What could be the possible error??? Is there any other method we can do the same??
    Thanks in Advance.
    Jaspreet

    Hi
    U can try this way.
    *& Report  Z_DEMO_JG
    *& Display average in ALV report
    REPORT  z_demo_jg LINE-SIZE 80 LINE-COUNT 50
                                         NO STANDARD PAGE HEADING.
    TABLES: sflight.
    TYPE-POOLS: slis.
    * Data declaration
    DATA: i_flight TYPE STANDARD TABLE OF sflight,
          i_catalog TYPE slis_t_fieldcat_alv,
          w_flight TYPE sflight,
          w_catalog TYPE slis_fieldcat_alv.
    DATA: v_repid TYPE syrepid.
    * Selection screen
    SELECT-OPTIONS: s_carrid FOR sflight-carrid.
    START-OF-SELECTION.
    * Fetch data from sflight table
      SELECT *
       FROM sflight
      INTO TABLE i_flight
      WHERE carrid IN s_carrid.
      CHECK sy-subrc = 0.
      v_repid = sy-repid.
    * Build field catalog for ALV report
      PERFORM build_catalog.
    * Display ALV report
      PERFORM display_report.
    *&      Form  build_catalog
    *       Build field catalog for ALV report
    *       None
    FORM build_catalog .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = v_repid
          i_structure_name       = 'SFLIGHT'
        CHANGING
          ct_fieldcat            = i_catalog
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc = 0.
    *   For average populate 'C' as value in
    *   field DO_SUM
        w_catalog-do_sum = 'C'. " C = Average
    *   Modify record with new value
        MODIFY i_catalog FROM w_catalog TRANSPORTING
        do_sum WHERE fieldname = 'PRICE'.
      ENDIF.
    ENDFORM.                    " build_catalog
    *&      Form  display_report
    *       Display ALV report
    *       None
    FORM display_report .
      IF i_catalog[] IS NOT INITIAL.
    *   Call ALV grid
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = v_repid
            it_fieldcat        = i_catalog
          TABLES
            t_outtab           = i_flight
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
        IF sy-subrc = 0.
        ENDIF.
      ENDIF.
    ENDFORM.                    " display_report
    Edited by: meetjoe on Sep 15, 2009 7:17 PM

Maybe you are looking for

  • Clicking on document link opens Safari, but Safari doesn't open link

    For some time -- even before upgrading to OS10.8 -- I've been having an issue with Safari. I receive links in emails or other documents, click on them, and when Safari opens, it fails to load the link. Sometimes I see the URL appear in the address ba

  • When will I get help?

    Your tech people have installed Adobe X on my machine and could not get the program to start. When trying to open this error message comes up,  0x01377035 with memory at 0x01b13194. My case # is 184812945. I need help to open this program. Sam Winter

  • Firefox Addons: Custom addon does not run

    PS: My problem changed a little bit. In the first post you see my original problem, please see #4 for the current one. Hey everyone, to collect some traffic data I call Firefox from a bash script. I use a proxy to connect to the loading speed is rath

  • Problem with rv_message_update

    Hi All,      I am using FM 'rv_message_update' in my program for creating nast entry and issuing output. When i send single output type with single medium, it is working fine. But when i send single medium with multiple mediums, only creating last en

  • Function overloading in flex?

    Hi Is it possible to function overloading in flex? Any send me example. Regards D.Mahesh Babu