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

SUM of Distinct counts

Status
Not open for further replies.

nikol

Programmer
Apr 12, 2005
126
US
Hi,
How can I sum a field which has Distinct count of nos.
Zipcodes UId
95051 1
1
2
Total: 4
76891 3
3
Total: 6
96456 1
1
Total: 2
-----
Subtotal: 12( Sum of{Distinct Count of uid})
-----
I got UID field from "Insert Summary of all clients" then distinct count of them group by zipcodes..
 
If the UID does not appear in more than one zip, then

Insert->Grand Total and select distinct count on {UID}


Otherwise,

Create a formula that concatenates the zip with the uid

@zipuid
totext({zip},0,"")+"-"+totext({uid},0,"")

Insert->Grand Total and select distinct count on @zipuid

-lw

 
I used the first thing to get distinct count of uid's. Now I want to find the SUM of Distinct counts..Like I described earlier was "12
 
You've offered little in the way of technical information, as there are diferent ways to accomplish this, but in either case you might create a formula, as in:

Create a formula in the zipcode group header or group footer which has:

numbervar MyCount := MyCount + sum({table.id},{table.zip})

Now you can reference it in a formula in the report footer, as in:

numbervar MyCount

-k

 
Hi,
The 'Grand Total' IS a SUM of all the UIDs ( actually a distinct count, which is the same thing) and appears in the report footer.

Counting all the separate UIDs or adding up the subtotals will give the same results, unless a UID can appear in more than one zip..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top