Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: report sorting but sum 2 lines Post Reply Post New Topic
Author Message
jooky
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 3
Quote jooky Replybullet Topic: report sorting but sum 2 lines
     Posted: 08 Apr 2011 at 8:57am
I have a report that is group sorted by CostType. These are 1,2,3,4... and are ascending through the report.

I have been asked to sum costtype 1 and 7
So far I removed 7 from showing by adding

{JCCT.CostType} <> 7

Now I want cost type 1 to include costtype 7.. something like this.

//if {JCCT.CostType} = 1 then sum ({JCCT.CostType} = "1" ,{JCCT.CostType} = "7")

Any ideas?  I have no programming background so I am stumped.


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Apr 2011 at 3:31am
NOt sure I understand your question exactly but you cannot exclude data and also sum it.
If you want to regroup the data use a formula
if {JCCT.CostType} in [1,7] then "1 and 7" else
totext({JCCT.CostType} ,0,"")
group on this fomrula field and then d0 a sum on it
 
 
 


Edited by DBlank - 12 Apr 2011 at 11:55am
IP IP Logged
jooky
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 3
Quote jooky Replybullet Posted: 12 Apr 2011 at 11:32am
Thanks for trying...
I get "a boolean is required here"
 I am just trying to add 2 rows together.
I have a report that prints

cost type   estimate  actual    balance

1 labor        100         100          0
2 materials   200        100       100
7 burden      500         600      -100
10 tax           0             0           0

They want me to combine the labor and burden
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Apr 2011 at 11:56am
Do not place the formula I gave you in the select expert but rather create a formula in the Field Explorer.
IP IP Logged
jooky
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 3
Quote jooky Replybullet Posted: 13 Apr 2011 at 9:45am
Ah! Thank you ,getting the right stuff now.
looks like you can teach a old dog new tricks.

Thanks,
tim
IP IP Logged
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