Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Multiple lines being created Post Reply Post New Topic
Author Message
micahjclark
Newbie
Newbie
Avatar

Joined: 17 Jun 2014
Online Status: Offline
Posts: 3
Quote micahjclark Replybullet Topic: Multiple lines being created
     Posted: 17 Jun 2014 at 9:59am
I am new to CR and trying to create a report. I have a formula created if {dbtable.field}='FieldName' then 1 - then I have a running total sum those items to show on the report. My problem is that I am getting multiple lines for the summary. Any idea of what I need to do to correct this in some type of formula. If more info is needed to help answer question let me know.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 17 Jun 2014 at 10:03am
are you adding text to a variable or something like that?

I guess it depends on what exactly you're doing and how the statements are evaluated.

Code or pseudo code would be nice.
IP IP Logged
micahjclark
Newbie
Newbie
Avatar

Joined: 17 Jun 2014
Online Status: Offline
Posts: 3
Quote micahjclark Replybullet Posted: 17 Jun 2014 at 10:36am
I am searching the database for specific text to be found within the parameter that is set. The parameter is date range and a location called agency. I have it working but it gives me 3 lines every time when I would assume that having it sum it should only put 1 line for each summary.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 17 Jun 2014 at 2:13pm
Since you're just trying to get a count, instead of doing a sum, try this:

1. Change your formula to return a unique ID number instead of the number 1.

2. Change the running total to do a "Distinct Count".

-Dell
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Jun 2014 at 4:22am
Just a word of caution. If you use an if-then formula to return something for a distinct count it will include the false result (likely a 0 here) as part of the count so the running total result usually is over by a value of 1. You can use the NULL trepalcement trick but a simpler apporach is to forego the if-then formula entirely and just use the condition in the Running Total's evalution formula
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