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.
Mar 9, 2007
48
US
Hello all. Possibly this is an easy question and I apologize if it's been repeated. I have queried this forum and cannot find the solution (possibly I didn't know how to ask it correctly).

I'm using XI and connecting to an Access DB via ODBC. I'm trying to count the number of unique values that appear in a field. For example, there is a field called Q1 that could contain a value of 1 through 4.

Q1
1
1
1
3
2
2
3
4
4
1
3

In this example I would like to count the number of times the number 3 appears in the Q1 field. How would one go about doing that? Any help is appreciated.
 
Create a running total. That counts Q1, then in the evalaute section, click on the formula and enter
{FieldQ1} = 3.

RT will only increment when it encounters a 3

Ian
 
Another approach would be to create conditional formulas like this:

//{@count4s}:
if {table.field} = 4 then 1

Then you would place this formula in the detail section, right click on it, and insert a summary (Sum, not count).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top