Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: adding value of a column Post Reply Post New Topic
Author Message
sign_seventh
Newbie
Newbie


Joined: 14 Aug 2008
Location: Philippines
Online Status: Offline
Posts: 11
Quote sign_seventh Replybullet Topic: adding value of a column
    Posted: 09 Sep 2008 at 11:12pm

how can i sum up all value of a column base on a value from other column?

here is a sample data:
 
clientname value
aa              1
aa              1
aa              3
bb              1
bb              1
bb              3
 
 
i want to add all value base on clientname and put answer in the bottom like this one
 
clientname value
aa              1
                  1
                  3
---------------------
                  5
 
bb              1
                  1
                 3
---------------------
                  5
 
thnx for the help in advance
IP IP Logged
dfolzenlogen
Newbie
Newbie
Avatar

Joined: 23 Feb 2008
Location: United States
Online Status: Offline
Posts: 36
Quote dfolzenlogen Replybullet Posted: 10 Sep 2008 at 3:25am
You would Group on your field called "clientname";
 
Insert a Summary in the Group Footer based on your field "value" and summarize on "sum" with your Summary Location being your Group (see dropdowns for all these choices);
 
Format the field "clientname" to "suppress if duplicated" so that only the first instance of "clientname" appears.
IP IP Logged
sign_seventh
Newbie
Newbie


Joined: 14 Aug 2008
Location: Philippines
Online Status: Offline
Posts: 11
Quote sign_seventh Replybullet Posted: 10 Sep 2008 at 8:21pm
thnx for the help
IP IP Logged
sign_seventh
Newbie
Newbie


Joined: 14 Aug 2008
Location: Philippines
Online Status: Offline
Posts: 11
Quote sign_seventh Replybullet Posted: 11 Sep 2008 at 6:35pm
hi all,
 i like really what dfolzenlogen said, but there's no "sum" option in calculate this summary. all i can see is max, min,count,distinct count,mode, nth largest, nth smallest,nth most frequent.
is there any other simple way.
thnx
IP IP Logged
dfolzenlogen
Newbie
Newbie
Avatar

Joined: 23 Feb 2008
Location: United States
Online Status: Offline
Posts: 36
Quote dfolzenlogen Replybullet Posted: 11 Sep 2008 at 7:24pm
Are you trying to sum your text field?  Make sure that you are referring to your value field which should be numeric.  The choices you are given in the "option to calculate" depends on the field type.  Let me know if that works.
IP IP Logged
sign_seventh
Newbie
Newbie


Joined: 14 Aug 2008
Location: Philippines
Online Status: Offline
Posts: 11
Quote sign_seventh Replybullet Posted: 11 Sep 2008 at 8:23pm
i pass a value for "share_amount" from a datasource to dataset1.xsd.
 
"share_amount" aka "value" is actually from a dataset1.xsd
i change its property to system.decimal.
 
in my stored proc.
i set cast(sha_amount as numeric(8,2))  as share_amount
IP IP Logged
sign_seventh
Newbie
Newbie


Joined: 14 Aug 2008
Location: Philippines
Online Status: Offline
Posts: 11
Quote sign_seventh Replybullet Posted: 11 Sep 2008 at 11:33pm
finally i got the answer, just want to share it to everyone.
 
i create formula fields named "sum_amount". then  i put this code.
 
if isnull({GetSaleDetails.SHA_AMOUNT}) then 0
else cdbl({GetSaleDetails.SHA_AMOUNT})
 
then i go back to summarize get the "sum_amount"
then select "sum" in calculate option. :D
 
dfolzenlogen is right again. options to calculate depends on the field type. so if field is string you cant see "sum" option.
 
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.012 seconds.