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

Count one or first occurence to compute percentage 2

Status
Not open for further replies.

deswalker

Programmer
Aug 10, 2005
7
US
Using CR10, I'm looking to determine the percent screened by age group, but the numerator should not include duplicate members with a screening.
ex.
Member AgeGroup Screened
1 6-9 yrs Y
1 6-9 yrs Y
1 6-9 yrs N
2 6-9 yrs N
3 6-9 yrs Y
3 6-9 yrs N
I need to report:
Members screened Pct.

3 2 67%

 
You can accomplish this by inserting a distinctcount on MemberID and then using a running total {#screened}, where you use a distinctcount of MemberID, evaluate using a formula:

{table.screened} = "Y"

reset never.

Then create a formula for the percentage:

{#screened} % distinctcount({table.memberID})

IF you are doing this at the group level, then reset the running total on change of group, and add a group condition to the distinctcount.

-LB
 
Use 'distinct count' of members to get the total no. of members. Group on 'members' and have a formula which counts only 'Y's i.e.,
//formula
if {table.Screened}='Y' then
numbervar x:=1 else 0

then have a 'maximum' of formula by 'member' group. If it is not 0 then that means that member is screened.
 
Thanks for the posts. Also I neglected to say that the report also breaks on age group. (there are many age groups)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top