Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 2008 - Count a Summarized Field

Status
Not open for further replies.

progenysend

Technical User
Feb 15, 2008
41
US
I've got some data that doesn't really have a unique identifier, so I create one through grouping.

Say there's 5 detail lines for every Group 1 line. A test is done that returns a Yes or No for each line, ultimately leading to a Yes or No in Group 1. I have to come to this by manipulating how the data is sorted, excluding certain lines, and taking a maximum.

I need a way to count the Group 1 Yes and No.

Right now I either get numbers that are way too high because it's counting every detail, or I get double counting because it adds 1 if there is a yes or no in the details.
 
You have to share the content of the formulas you are using for Yes/No and for the group summary where you are using the maximum.

-LB
 
I'm getting my Yes/No with this:

IF (ISNULL({@Age at Call Business Days}) OR {@Age at Call} = 0 OR {@Age at Call Business Days} > 1)
THEN "No"
ELSE IF {@Age at Call Business Days} <= 1 AND {@Age at Call Business Days} <> 0
THEN "Yes"

I'm making sure the right one is displayed in the grouping here:

IF {Activity.Type} IN ["Outbound Call" , "Call Back Made"] THEN
(IF (MINIMUM({@Outbound Call Date} , {Activity.Type}) - MINIMUM({@Assignment Date} , {Activity.Type})) < 1
AND (MINIMUM({@Outbound Call Date} , {Activity.Type}) - MINIMUM({@Assignment Date} , {Activity.Type})) <> 0
THEN "Yes"
ELSE IF (MINIMUM({@Outbound Call Date} , {Activity.Type}) - MINIMUM({@Assignment Date} , {Activity.Type})) > 1
OR (MINIMUM({@Outbound Call Date} , {Activity.Type}) - MINIMUM({@Assignment Date} , {Activity.Type})) = 0
THEN "No")
ELSE "No
 
Okay, that's way too complex. When asked for the content of formulas, that includes nested formulas, but I don't really want to see so many. You can handle this with variables:

whileprintingrecords;
numbervar cntyes;
numbervar cntno;
if {@yourfinalyesnoformula} = "Yes" then
cntyes := cntyes + 1;
if {@yourfinalyesnoformula} = "No" then
cntno := cntno + 1;

Place this formula in the group section where the correct yes/no is displayed and suppress it.

Then in the report footer use two separate formulas to display the results:

//{@yes}:
whileprintingrecords;
numbervar cntyes;

//{@no}:
whileprintingrecords;
numbervar cntno;

-LB
 
Thanks for your help on this. You explained it just the way I needed it.

Is there any way to make this, or something similar, work in a graph?
 
I'm not sure about the functionality of CR2008--I don't have it, but in earlier versions I think you would have to use a complex method outlined in a Crystal Reports technical paper called "Charting on Print-time formulas".


Just say OK when asked for a certificate.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top