Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Average of running total in crystal report

Posted on 2009-07-09
6
Medium Priority
?
653 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 101

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 101

Accepted Solution

by:
mlmcc earned 2000 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
DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

 

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

Python: Series & Data Frames With Pandas

Learn the basics of Python’s pandas library of series & data frames and how we can use these tools for data manipulation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

722 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