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

Use Sum(distinct count) in

Status
Not open for further replies.

xmj0908

MIS
Dec 6, 2011
6
US
My scenario is like this, I grouped by person and then by date, but there are a lot of records in one day, and now I only care about distinct count of days under each person, i used

shared numbervar sumofd:=sumofd + DistinctCount ({date}, {people})

and then display

local numbervar totalcount:= shared numbervar sumofd(say it is 9)

in the report footer so that I get a overall sum of distinct count of days.

The questions is that i need to go back to each group and do a calculation DistinctCount ({date}, {people})/totalcount(eg.9)

I just don't know how to do that becasue when I go back to each group, it is giving me the running total as the denominator.

Eg.
PersonA
9/1 3.00
9/2 4.00
9/3 3.58
9/10 4.08
Distinctcount of Date for A = 4

PersonB
9/3 8.67
9/9 6.76
9/13 1.90
9/17 2.68
9/25 3.50
Distinctcount of Date for B = 5

Total DistinctCount = 9

now I want calculate for A=4/9 and for B=5/9
instead, it is giving me A = 4/4 and B = 5/9

I am still a new user of Crystal Report, this problem has bothered me for a long time, I really appreciate if someone can help me to solve this. Thank you so much. :)

 
Please don't post the same question twice. If you do it accidentally, please note your error so no one wastes time on a duplicate.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top