Solved

Average of running total in crystal report

Posted on 2009-07-09
6
641 Views
Last Modified: 2013-11-26
Hi Experts

I have a windows application and a Crystal report on it. I use the running total to get a sum of money per group. And when I try to get the average of that running total it says: "This field cannot be summarized". Okthen I tried to do it manually: sum({@Consumption}) / {#Count} But then when I run the report it says: "Division by zero" Can you please help me on getting the average in a report?

Thanx in advance
0
Comment
Question by:Benvor
  • 4
  • 2
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 24811554
A running total is calculated as the report is printed.  Summary functions are done much earlier in the report process.

Where did you put the Average formula?

What is #Count?

What is the formula for @Consumption?

mlmcc
0
 

Author Comment

by:Benvor
ID: 24811586
1) I put the Average Formula in a Group Footer

2) #count is a running total set to 'Count' instead of 'Sum' to get the total amount of items to divide by

3) @Consumption = ({FuelRecords.Kilometers} - {FuelRecords.PrevKM}) / {FuelRecords.Fuel}
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24814791
Do you have a group with no records?

You can eliminate the 0 divide error in this way

If {#Count} =  0 then
    0
else
    sum({@Consumption}) / {#Count}

mlmcc
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:Benvor
ID: 24820782
There isn't supposed to be a group with no records. But I tried your formula but I still get the error, Division by zero.
0
 

Author Comment

by:Benvor
ID: 24821180
Please anyone help me to get the average of a sum value please?
0
 

Author Comment

by:Benvor
ID: 24821394
Thanx mlmcc for all your help, When I actually ran the program for the first time the error was much more descriptive and I could get the problem. So for anyone who just switches between views on your crystal report and get errors that don't explain anything, just run the program then the error will give you an exact description
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now