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!

Group DistinctCount

Status
Not open for further replies.

brxmas

Programmer
Feb 9, 2004
69
0
0
US
SQL 2000
Crystal XI

I have a group on a report {class_group_desc} I need to have a DISTINCTCOUNT for each {ad_num}

Formula {@emp}:
distinctcount({@dist})-1

Formula {@dist}
If {mc_period_dates.period_year} IN [2006] AND
{mc_period_dates.period} = 5 AND
{mc_ad_detail_view.class_group_desc} = "Employment" THEN
(
{mc_ad_detail_view.ad_num}
)

ELSE
If {mc_period_dates.period_year} IN [2006] AND
{mc_period_dates.period} = 5 AND
{mc_ad_detail_view.class_group_desc} = "Garage"
THEN
(
{mc_ad_detail_view.ad_num}
)
;

What I need to accomplish is to have a DISTINCTCOUNT for each {mc_ad_detail_view.class_group_desc}, see example:

Employment 254
Garage 397
Income 121

When I do an IF ELSE above it totals all class_group_desc
Employment 772

If anyone can help me, I would appreciate it. Thanks in advance.
 
Nevermind, I can create a formula and group it by it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top