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

Distinctcount with a condition in Formula 1

Status
Not open for further replies.

saradaga

Programmer
Jul 10, 2008
22
US
Hi,
I am using the formula
IF {FF_ASS_UNIT_RCVE_INT_WEEK_VIEW.ELIG_ADULT_CHILD} = "ELIGIBLE ADULT"
THEN
DISTINCTCOUNT({FF_ASS_UNIT_RCVE_INT_WEEK_VIEW.CLIENT_MEMB})

here crystal is not considering the condition
{FF_ASS_UNIT_RCVE_INT_WEEK_VIEW.ELIG_ADULT_CHILD = "ELIGIBLE ADULT"

and giving me the distinctcount for all the records.
How can i do a distinctcount with a condition in the formula
Any help is appreciated

Thanks.
 
You should first create a formula {@null} by opening and saving a formula without entering anything. Then create a formula like this:

IF {FF_ASS_UNIT_RCVE_INT_WEEK_VIEW.ELIG_ADULT_CHILD} = "ELIGIBLE ADULT" THEN
{FF_ASS_UNIT_RCVE_INT_WEEK_VIEW.CLIENT_MEMB} else
tonumber({@null})

Remove the tonumber() if the client_memb field is a string. Then right click on this new formula and insert a distinctcount. Your formula was simply saying if the current record = "Eligible Adult", show me the distinctcount of all members.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top