|
-
Jan 4th, 2006, 11:22 AM
#1
Thread Starter
Member
Resetting a variable for new group
I have a report that simply counts the number of times a field is true.
This works fine for the first group, but then falls down. The variable continues counting, how do I reset it for every group.
Here is one of the formula I am using:
Shared numberVar CountOfAwaitingOutcome;
If {tbl_Enquiry.AwaitingOutcome} = "Yes" Then
CountOfAwaitingOutcome := CountOfAwaitingOutcome + 1
The whole report is grouped by the type of procedure... So for example
There may be 3 waiting for Botox, and 1 waiting for Hip.
My reports shows
Botox 3
Hip 4
I want it to show
Botox 3
Hip 1
Can anyone help?
Many thanks
Mark
-
Jan 4th, 2006, 11:28 AM
#2
Re: Resetting a variable for new group
How does your forumla know when it is finished with a particular group?
-
Jan 4th, 2006, 11:49 AM
#3
Thread Starter
Member
Re: Resetting a variable for new group
Currently, it doesn't. But I want it to know when the group changes as i need to reset it.
-
Jan 4th, 2006, 02:45 PM
#4
Addicted Member
Re: Resetting a variable for new group
Don't actually count with a shared variable on your detail record, create a separate formula say AwaitingOutcome10 with
If {tbl_Enquiry.AwaitingOutcome} = "Yes" Then 1
Else 0
Drop that on the details section. Next insert a summary field ("Sum" calc type) on the AwaitingOutcome10 formula for your Group "Type". Last if so choose insert a summary ("Sum" calc type) on the Report Footer for a grand total count. You can suppress the AwaitingOutcome10 formula in the details section once you confirm the totals are working correct.
-
Jan 6th, 2006, 04:34 PM
#5
Re: Resetting a variable for new group
To clear/reset a shared variable you need to create another formula and place it in the section where the variable should be reset.
Code:
Shared numberVar CountOfAwaitingOutcome;
CountOfAwaitingOutcome := 0
In this case, put the formula in the Group Header section and Suppress it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|