I have a report setup to pull in all people based of an age range. Then a custom formula to show if the patient had a colonscopy. I am trying to calculate how many people had a colonscopy. I have created a custom field to return 1 if they had a colonscopy. I then have tried to calculate this return using 3 formula fields. The problem is my patient tally is not totaling.
Placed in the Group Header 1
WhilePrintingRecords; NumberVar CCount := 0;
Placed in the Group header 2
WhilePrintingRecords; NumberVar CCount := 0; If {@colonnum1} = '1' then CCount := CCount + 1;
Placed in the group Footer
WhilePrintingRecords; NumberVar CCount;
jdrew14 said:
I have a report setup to pull in all people based of an age range. Then a custom formula to show if the patient had a colonscopy. I am trying to calculate how many people had a colonscopy. I have created a custom field to return 1 if they had a colonscopy. I then have tried to calculate this return using 3 formula fields. The problem is my patient tally is not totaling.
Placed in the Group Header 1
WhilePrintingRecords; NumberVar CCount := 0;Placed in the Group header 2WhilePrintingRecords; NumberVar CCount := 0; If {@colonnum1} = '1' then CCount := CCount + 1;Placed in the group FooterWhilePrintingRecords; NumberVar CCount;
You're resetting your counter in the Group Header 2 formula. First two lines before count logic should just be:
WhilePrintingRecords; NumberVar CCount;
JClarkLRGH said:
jdrew14 said:
I have a report setup to pull in all people based of an age range. Then a custom formula to show if the patient had a colonscopy. I am trying to calculate how many people had a colonscopy. I have created a custom field to return 1 if they had a colonscopy. I then have tried to calculate this return using 3 formula fields. The problem is my patient tally is not totaling.
Placed in the Group Header 1
WhilePrintingRecords; NumberVar CCount := 0;Placed in the Group header 2WhilePrintingRecords; NumberVar CCount := 0; If {@colonnum1} = '1' then CCount := CCount + 1;Placed in the group FooterWhilePrintingRecords; NumberVar CCount;You're resetting your counter in the Group Header 2 formula. First two lines before count logic should just be:
?
WhilePrintingRecords; NumberVar CCount;
You are also missing the else condition in group header 2. Should be:
If {@colonnum1} = '1' then CCount := CCount + 1 else CCount := CCount;
Also, make sure the data type of @colonnum1 is actually a string and not a number. If a number value you won't need quotes on the "1".