on 09-18-2008 10:32 AM
Hi,
i want to count items in a group. Normally this can be done using a group counter. What I need is to decide if an item matches a certain condition only then the count should be increased.
Kind regards
Patrick
Hi Patrick,
This can be done using RunningTotals :
Create a running total from Field explorer.
--Select the field to count and select type of summary Count
--In Evaluate select Use a formula
Then give the condition like .. If = <value> then True
--Under Reset select on Change of Group.
Place this formula on group footer to display the count for each group.
Thanks,
Sastry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Brian,
my problem is that I want to decide if a goup has changed in the formula. So I use the following code to decide if group has changed or not:
if Previous({Befehl.TicketID}) = {Befehl.TicketID} then
1
else
0;
After having inserted the formula in the details section the insert menu only offers "field title" but not "Summary"
Kind Regards
Patrick
Edited by: Patrick Jox on Sep 19, 2008 8:54 AM
A third way to do it is to create a simple formula that you can insert a summary on. I prefer this method when I can use it because it is the most efficient because Crystal will perform it before the records are printed. The other two methods that were suggested will work too, but they are performed while records are being printed.
Create this formula:
//@Counter
if {table.field} = "Match"
then 1
else 0
Then you can insert a summary on it using the Insert menu, Summary command. Pick the formula, choose the summary type (should be Sum), and then pick the Group you want to total it at.
If you need a summary at another level (group or report level), you can simply copy the created summary field, and paste it in any other group header/footer or report header/footer.
Edited by: Brian Reed on Sep 18, 2008 3:48 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Patrick,
You can try below Formula:
// For instance, if Condition is Last Yearu2019s Sales > $5000 then increase the Counter.
//Create a formula named As @CalculateCount to display the number of Records which matches above condition. Place this formula in the Detail Section.
WhilePrintingRecords;
Global numberVar counter;
If {Tablename.Last Yearu2019s Sales} > $ 5000 then
Counter := counter + 1;
Regards,
Alpana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.