Sum of Averages?

Hello All,
Am extremely frustrated at this point so i thought I'd post here and maybe someone can help me with a solution.  I have a report that I created that shows me the average amount of charges for a day.  How do I take a sum of the averages for for each day?  If i try to insert a summary and then use the average field it gives me an error.  Anyways around this?

Since you are able to get the avg amt for each charge ID then create formula like this
whileprintingrecords;
numbervar i;
i:=i+Average value calcualted;
Place this in ChargeID group footer.
Now create another formula like this
whileprintingrecords;
numbervar i;
Place this in report footer which shows the sum of average.
Hope this helps!
Regards,
Raghavendra

Similar Messages

  • A Beginners Outcry: Homework of sum and Average

    Dear all,
    I am a java dummie. This is what happens intuitively in my mind. I need a program that runs to calculate the sum and average of either positive or negative inputed integers. The maximum input integers = 100. As defined, sn = sum of negative integers, sp = sum of positive, in = count of negative integers, ip = count of positive integers. If input integer = 0, the program comes to an end. If input integer is non zero, the outcomes would be sum of negative and sum of positive, average of negative and average of negative. I think I should use do-while statement, but..... Also, for the input, should I input a list of integers....Can someone show me the code plus some brief explanation that a beginner like me would be able to understand? Thanks.

    yawmark wrote:
    Can someone show me the code plus some brief explanation that a beginner like me would be able to understand?
    [So, You Need to Write a Program but Don't Know How to Start|http://home.earthlink.net/~patricia_shanahan/beginner.html].
    ~Ta. I just read through that article again, and again I find myself in awe of the sageness of such simple advise... I'm bookmarking it, to reread whenever I feel like tearing my hair out over a problem.
    Cheers. Keith.

  • Subtotals - sum of average column

    Hi,
    I am new to PowerPivot so please excuse me if this is a stupid question.  I have a pivot table that uses a SQL view as its data source.  The pivot table looks like this:
    Price = average
    Qty = sum
    Value = sum
    Budget = average
    The way the view has been written the budget figure is given to grouping Customer + Product + MonthYear.  So, if I drop it into the pivot table as an average it comes up correctly.  The problem for me is that I want to turn on subtotals
    and get the sum of the average'd budget lines in the rowgroup above.  I have read that I can do this with PowerPivot by createing measures.  I guess my question really is "How do I use a measure in place of a subtotal in a pivot table
    report - how would I drag and drop it into place so it repeats as a subtotal would?"  The next question would be how would I write this measure?
    TIA

    Hi Julina,
    I had seen those threads before but didn't quite understand them.  I have got it now.  This is the formula that I have come up with, but I still get the averages of the averages, and not the sum of the averages:
    IF(COUNTROWS(VALUES(vwComprehensiveDeliveries_YRN[CustomerName]))>1,
    SUMX(
    SUMMARIZE(
    vwComprehensiveDeliveries_YRN,
    vwComprehensiveDeliveries_YRN[CustomerName],
    vwComprehensiveDeliveries_YRN[Product],
    vwComprehensiveDeliveries_YRN[BL_Year],
    vwComprehensiveDeliveries_YRN[BL_Qtr],
    vwComprehensiveDeliveries_YRN[BL_Month],
    "Customer Subtotal", AVERAGE(vwComprehensiveDeliveries_YRN[BudgetValue])
    [Customer Subtotal])
    AVERAGE(vwComprehensiveDeliveries_YRN[BudgetValue])
    I have tried it with only grouping SUMMARIZE by CustomerName, and combinations of the ones you see above. What have I done wrong?
    Thanks,
    C

  • Sum and Average Group Wage instead of Details Wage

    I have a subreport where I have included all of our employment records and grouped it by employee ID. In the Group Footer, to show the latest employment record I used the Max(Start Date) and I have also placed the Hourly Wage field here which shows the appropriate Wage for the Max Date. But I can't seem to use the Sum or Average Summary because it Sums and Averages All Wages in the Details report vs. only the latest record.
    So, how do I Sum/Average the wages for only the last employment record Or how do I create the report to show only the Last Employment Record?
    I'm using Crystal XI. Any help will be greatly appreciated.
    Thanks

    Place the fields in group header instead of placing in details section using maximum() function. Now got to report>record sort expert>add start date field-->select descending order.
    Now the report shows latest date entries for each group.
    If you want to calcualte the sum then use mannual running totals like
    create a formula like
    @sum:
    whileprintingrecords;
    numbervar i;
    i:=i+{field}
    Now place this in group header and supress
    create another formula like
    @Total:
    whileprintingrecords;
    numbervar i;
    place this in report footer which gives grand total.
    Regards,
    Raghavendra

  • Sum and average of a list of integers

    heya all
    im trying Implement a program to find the sum and average of a list of integers terminated by the data marker -999.
    import java.util.*;
    public class sumaverage
       public static void main(String[] args)
    int sum = 0;     // input the first number
           int num = kybd.nextInt(); // kybd is an instance of Scanner
           while ( num != -999 )    // while the end of data not found
                sum += num ;
                num = kybd.nextInt(); // input the next number
           System.out.println("the sum is " + sum );
    }}Currently im getting " cant find symbol" on lines 10 + 16 pointing at the k in kybd.nextInt(); , could anyone tell me whats wrong as im lost ?
    Thankyou

    thanks mate , i cant belive i missed that :S
    im now trying to add the adverage to the code
    ive done the following coding , can anyone confirm this is correct ? it all compiles fine ...
    import java.util.*;
    public class sumaverage
       public static void main(String[] args)
         Scanner kybd = new Scanner(System.in);
         int sum = 0;     // input the first number
         int n;
         double Adverage = 0;
           int num = kybd.nextInt(); // kybd is an instance of Scanner
           while ( num != -999 )    // while the end of data not found
                sum += num ;
             n = kybd.nextInt();
                sum += n;
             Adverage = sum/n;
                num = kybd.nextInt(); // input the next number
           System.out.println("the sum is " + sum );
           System.out.println("The adverage of the integers is " + Adverage);
    }}

  • Sum of Average Field

    Post Author: jehanzeb
    CA Forum: Crystal Reports
    Hello all,
    I am wondering how can you get a grand total of "Average". I have a field in the report with Average per day per lense. Now at the end of the report I would like to show the grand total of all those averages.
    Example:
    Average Per day
    2.00
    3.00
    1.50
    At the end of the page (footer) it should show grand total of 6.50.
    How can I achive this?
    Help pleaseeee
    I have tried sum, count, distrnt count etc but none seems to be working (tried the summary function key as well).
    Regards
    Jehanzeb

    Post Author: jehanzeb
    CA Forum: Crystal Reports
    Morning Khalil,
    Firstly thanks for the kind reply. I have tried your explained method but unfortunately it didn't work, infact it has changed the values to 1.00 all the way.
    Example -
    Whileprintingrecords;Global Numbervar FAvg:=0; ( This stayed at it is and has been inserted onto the header - upon initialisation it is shown as 0 which is fine).
    Whileprintingrecords;Numbervar FAvg;FAvg := FAvg+ {lab_rework.rework_qty}; ( The rework qty is the field which needs to be averaged - example  from 01/05/2008 to 02/05/2008 there were 3 lenses which were reworked, so the average should be 1.5 per lense per day. However, using your formula it shows 1.00)
    Whileprintingrecords;Numbervar FAvg; (This is the grand total of whatever the average field shows however this is showing 1.00 as well even though the records are showing 1.00, in theory this should add up all those 1.00s and should show 10.00 which it isnt.)
    I have tried using the built in average running total but it doesnt seem to work as it calculates the average of the first day and not all days. For example when I entered the date range from 01/05/2008 to 02/05/2008, it shows the average of the 01/05/08 day and not the total average of both days hence showing only 1.00 as it calculating only one day. This however should calculate the average of the days I enterd into the parameters i.e. according to the date range
    how can I achive the expected results (where it shows the average of all the lenses reworked according to the date range)?
    Many thanks
    Regards
    Jehanzeb

  • Sum of average in report with many joins

    hello all.  i have read a few other threads that are similar to my situation but nothing i've found that helps my specific situation.  it is probably in part to my lack of expertise but i am pretty much a newbie here so go easy on me. 
    in summary, i have an employee table (em), a rooms table (rm), and an organizational hierarchy table (org_hier).  em and rm tables are joined on the building, floor, and room fields that are in each table.  org_hier table can be linked to either em or rm.
    basically i am just trying to take the average area of each room (rm.area). here may be multiple occupants in a room and i don't want rm.area to be counted more than once which is the reason for the average.  i then want a sum of that average at each level of the org hierarchy by using groups and a grand total at the end.  the trick is that i am only looking for rooms that house certain employees, restricted by the em.em_id.  that is the only reason for the em table being included.
    would you all suggest using subreports somehow or is there a SQL function that would work best?  let me know if i am being too vague here.  what should my joins be? 
    thanks in advance,
    js

    thanks Sharon.  i think i'm getting closer to what i need.
    should i use the same running total in each group or will i need to create a new running total for each grouping?  should the running total evaluate on each record and reset on change of rm.rm_id?  is a manual running total different? 
    right now i am getting the right values at the room level but it is totalling all records of the room area at the floor level, not just the one instance.
    i can email a screenshot if it is helpful.  thanks for your help so far!

  • 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 Sum Group Averages

    Post Author: millerka
    CA Forum: Formula
    I hope someone can help i am new to Crystal reports I am usign version 11
    I am trying to sum a bunch of group averages see below
    GH1 Stop name
    D Boardings
    GF1 Average
    Basically I would like to sum all the averages of boardings for the various bus stops to gather a total avearge.
    I hope someone can offer some advice!
    Thanks in Advance.

    Post Author: synapsevampire
    CA Forum: Formula
    You'll want a formula in the group header or footer to accumulate the values:
    whileprintingrecords; numbervar TotValue := TotValue + average({table.boardings},{table.StopName});Now in the report footer compute the average:
    whileprintingrecords; numbervar TotValue;if distinctcount({table.StopName}) > 0 thenTotValue / distinctcount({table.StopName})else0
    -k

  • How to deal with Sum of Averages problem in BPC

    Hi All
    I have a situation where I am trying to calculate Averages.
    P1, P2 and P3 roll up to "All_Projects"
    Similar problem appears at Monthly level (which gets calculated correctly, but incorrectly at quarterly level).
    Please help, how we could possibly resolve this problem?
    Thanks
    AJ

    Hi Ankur,
    Please, read my document Average percent values on nodes to understand how to work with average figures.
    B.R. Vadim

  • BEx Query Formating - Displaying both Sum and Average in the same report

    Hi everybody,
    I need to create a BW report in the below format,
                          Company Code                                            Total       Total Average
                                   0001            0002      0003      0004
    Doc Type
        AV                        10               10         10         10            40                 10
        RV                        20               20         20         20            80                 20
    Getting the report till the 'Total' column is easy but having the 'Total Average' as a separate column is where I am stuck.
    Having the company code in the rows, and not clolumns, would have solved the issue but I need to keep the above format. Also I do not want to
    see the Total Average for every Company Code, just that of the 'Total'.
    In the Query Designer, in the Column section I have first the 'Company Code' and then the 'Count' in a structure, so whatever I add to this structure,
    is displayed for each Company Code, that means 2 columns for each Company code. This changes the format.
    I cannot use the Cell Definition method here, as then it would be a static structure and the number of Company Codes are not fixed.
    It would be great if somebody could provide some suggestions.
    Thank you,
    Ajay

    Hi Suman,
    Thanks for the quick reply.
    I have tried this, but again this will change the format. With the way you said, I will only get the report in the below 2 formats,
    1. Company code in Free Charac, later drill down to Rows,
    Doc Type  Company Code  
        AV                 0001                10
        AV                 0002                10
        AV                 0003                10
        AV                 0004                10
        Total                                      40
        RV                 0001                20
        RV                 0002                20
        RV                 0003                20
        RV                 0004                20
        Total                                      80
    or 2. Company code in Free Charac, later drill down to Column,
                      Company Code                                       
                               0001                     0002                     0003                     0004    
                        Total    Total Avg   Total   Total Avg   Total   Total Avg  Total   Total Avg
    Doc Type
        AV             10           10             10         10           10         10           10           10
        RV             20           20             20         20           20         20           20           20
    Both the above are different from the format that I need.

  • Moving sums and averages - it is possible - any ideas??

    Customer wants a report with these conditions (values are entered by user at run time):
    * Start time - for example 2008/01/01 00:00 + (no problem, filter on time dimension) +
    * Stop time - for example 2008/01/31 23:59 + (no problem, filter on time dimension) +
    * Window size for examples: 1 day ; 3 days; 1 hour; 5 minutes
    * Step size for examples: 2 day ; 3 days; 1 hour; 15 minutes
    * Measures are agregated for every line by Windows size
    This mean that report looks like:
    "start time"                            MSUM(Measure1,"window size")           MAVG(Measure2,"window size")        MMAX(Measure1,"window size")
    "start time" + 1*"step size"              MSUM(Measure1,"window size")           MAVG(Measure2,"window size")        MMAX(Measure1,"window size")
    "start time" + 2*"step size"              MSUM(Measure1,"window size")           MAVG(Measure2,"window size")        MMAX(Measure1,"window size")
    "start time" + 3*"step size"              MSUM(Measure1,"window size")           MAVG(Measure2,"window size")        MMAX(Measure1,"window size")
    "start time" + 4*"step size"              MSUM(Measure1,"window size")           MAVG(Measure2,"window size")        MMAX(Measure1,"window size")
    "stop time"                              MSUM(Measure1,"window size")           MAVG(Measure2,"window size")        MMAX(Measure1,"window size")
    Start time = 2008/01/01 00:00, Stop time = 2008/01/02 00:00, Step size = 4 hours, Window size = 6 hours
    on line 1 MSUM(Measure1,"window size') = SUM(measure1) for time between 2008/01/01 00:00 and 2008/01/01 06:00
    on line 2 MSUM(Measure1,"window size') = SUM(measure1) for time between 2008/01/01 04:00 and 2008/01/01 10:00
    on line 3 MSUM(Measure1,"window size') = SUM(measure1) for time between 2008/01/01 08:00 and 2008/01/01 14:00
    on line 4 MSUM(Measure1,"window size') = SUM(measure1) for time between 2008/01/01 12:00 and 2008/01/01 18:00
    on line 5 MSUM(Measure1,"window size') = SUM(measure1) for time between 2008/01/01 16:00 and 2008/01/01 22:00
    on line 6 MSUM(Measure1,"window size') = SUM(measure1) for time between 2008/01/01 20:00 and 2008/01/02 02:00
    on line 7 MSUM(Measure1,"window size') = SUM(measure1) for time between 2008/01/02 00:00 and 2008/01/02 06:00
    2008/01/01 00:00                 120        20         10
    2008/01/01 04:00                 110        10         12
    2008/01/01 08:00                 140        23         10
    2008/01/01 12:00                 130        24         13
    2008/01/01 16:00                 110        50         40
    2008/01/01 20:00                 120        26         15
    2008/01/02 00:00                 110        23         10It's example only - _numbers are random_
    *Can someone know how to design this report???*
    Edited by: Vlada on Sep 30, 2008 8:52 AM
    Edited by: Vlada on Oct 7, 2008 7:54 AM
    Edited by: Vlada on Oct 10, 2008 12:03 PM

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Shut down your computer, wait 30 seconds, and then hold down the shift key while pressing the power button.
    When you see the gray Apple logo, release the shift key.
    If you are prompted to log in, type your password, and then hold down the shift key again as you click  Log in.
    *Note: If FileVault is enabled under OS X 10.7 or later, or if a firmware password is set, or if the boot volume is a software RAID, you can’t boot in safe mode. Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.  The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • When i highlight a group of cells the sum and average return a 0 yet there are numbers in the cells. Any ideas?

    I am using numbers to automatically calculate wages, when I highlight a group of cells containing the numbers 4 4 3 I would expect to get a sum value of 11 but i get nil? any ideas would be greatfully appreciated.

    Are the cells formatted as text rather than as numbers?

  • Accepting n numbers and Print their sum and average in Pl/SQL

    Hi All,
    I want to accept n number of values and i want to do some calculations on it.For this purpose I have tried "&" and "&&" operators. Is there any proper method for doing the same
    Thanks in advance
    Kiran

    hi
    I don't think that u can read from command line in frm a pl/sql block
    U may try using Java stored procedure/or other embeded language for that matter(example ..proc)
    ..................pushpi

  • In OBIEE Report Grand Total instead of Average(Average)  use Sum(Avg)?

    Hi All,
    In OBIEE Report Grand Total average always shows Average of average (Default) "avg(avg)" , can i overwrite this functionality to sum of average "sum(avg)".
    Thanks in advance
    Regards
    Kandasamy

    Hello,
    You can try the following:
    Remove the calculate result as setting for the three KFs.
    In exception aggregation set property to average with ref char as leave start date.
    Check if it works.
    If the above dosent work, set reference char to emplyee ID and check.
    Either one of them has to work
    REgards,
    Shashank
    Edited by: Shashank Dighe on Apr 2, 2009 9:03 AM

Maybe you are looking for