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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total on a Summary

Status
Not open for further replies.

wendle

Technical User
Jun 4, 2002
3
US
I am using Crystal 8.5. I have inserted a summary on a group and now want to put a total in Group footer 1 that counts how many "1's" there are in the group, how many "2's there are, how many "3's" and so on. Can anyone tell me what's wrong with the following formulas. I am getting the error "The summary/ running total field could not be created."

WhilePrintingRecords;
numberVar SumA1 := 0;

WhilePrintingRecords;
if (Count ({ContHist.ONDATE}, GroupName ({Contact1.KEY1}))) = 1
then numberVar SumA1 := SumA1+ 1;

WhilePrintingRecords;
numberVar SumA1 := SumA1;
 
You cannot sum any formula that is evaluated WhilePrintingRecords;

What are you trying to accomplish, I am sure there is another way to do it. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
I'm a beginner....can you tell?

My objective is to see how many appointments our sales reps have had with each record(or contact) in our database. I have inserted a summary on each record to add the # of appts. Then I want to put totals in the footer of each group(group being each sales rep) that count how many records within that group only had one appt, how many had 2 appts, how many had 3, and so on.
What should my formula look like?
 
You can't use the count function here.

You need to use the variable to be the counter, and then use the variable to illustrate your 1s, 2s, and 3 totals.

For example:

Group Header:
WhilePrintingRecords;
NumberVar SumA1 := 0;

Details:
WhilePrintingRecords;
NumberVar SumA1 := SumA1+ 1;

Group Footer:
//@A
WhilePrintingRecords;
numberVar SumA1;

//@B
WhilePrintingRecords;
If {@A} = 1 then NumberVar SumB1 := SumB1 + 1
Else
If {@A} = 2 then NumberVar SumB2 := SumB2 + 1;
...and so on...

Report Footer
//@C
WhilePrintingRecords;
Numbervar SumB1;
//Display Total of 1s

//@D
WhilePrintingRecords;
Numbervar SumB2;
//Display Total of 2s

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top