Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Problem with Sum Post Reply Post New Topic
Author Message
pucrilas
Newbie
Newbie


Joined: 17 Oct 2009
Online Status: Offline
Posts: 1
Quote pucrilas Replybullet Topic: Problem with Sum
    Posted: 17 Oct 2009 at 8:53am
Hello! I'm new to this forum and although I have a couple of years of experience with Crystal I've always used it for simple reports.

I am having a problem with a Formula I created.

Global NumberVar TotalAmount;
TotalAmount := {Table1.TotalEarned} / {Table.DividebyValue};

The problem I am having is that Table1 might have more than one row for each Table1.User field. For example

Table1.User Table1.TotalEarned
2001              100
2004              200
2001              350
2003              450

The problem is that the formula only takes into consideration the firt 100 instead of the sum of 450 which is the total for both entries for User 2001.

How can I fix it so it sums all the values that the table could have for each user??
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 19 Oct 2009 at 7:03am

since it is grouped on table1.user,

TotalAmount := sum({Table1.TotalEarned}, {table1.User}) / {Table.DividebyValue};
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.