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

Counting unique values

Status
Not open for further replies.

ajoyprabhu

Technical User
Sep 17, 2001
13
US
Hi all,

I have a query that pools several tables so that I can group data together. I am trying to count the number of UNIQUE values for two fields into a report, grouped by "location". Right now, my report counts the values including duplicates, per "location".

This is how I WANT the report (and in red is what it is doing):

Location A

Application#: 123 Doc#: abc
Application#: 222 Doc#:
Application#: 123 Doc#: xyz
--------------------------------
Count
summary:Apps: 2(3) Docs: 2(2)
--------------------------------

Location B...

...and so on...

I see that I can easily have the count working for blank vs. non-blank cells, but I still do not know how to count unique entires in reports.

Please help!!

Ajoy

 
Use a group by query with fields group by App, count App. Maq B-)
<insert witty signature here>
 
Maq,

SOrry about being daft about it. I am not sure if I udnerstood that. Am I to modifiy the existing query that the report uses, to group by these two fields? Or am I supposed to create two new fileds to hodl the data?

Again, apologize for my naivite.

Ajoy
 
Modify the existing query. It sounds like you already have a group by query, so just replace your count Docs field with a count App field. Maq B-)
<insert witty signature here>
 
I have a similar question but a little more detailed. Some sample data:

Section Class App# Doc# Entry#
1 1 1 1 1
1 1 1 2 2
1 2 1 1 3
1 2 2 3 4
1 3 2 3 5
1 3 3 1 6
1 1 3 2 7

The report sorts by section and by class then by Doc# and by App#
The report has parts: Report, Page, Section, Class.
In the Class part, I can get a Count of items in class by counting the any of the three (App, Doc, Entry) but I cannot figure out how to get a count on the unigue number of items in App# and Doc# for class. Everything that I try gives me the same number as I get for just regular Count. Can someone give me some help?
Thanks,
RaJay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top