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!

UNIQUE count in Summary Column 1

Status
Not open for further replies.

TaTips

Programmer
Oct 29, 2003
25
GB
Hi:

Reports 6i (c/s)

Sometimes I need to count "distinct" values in a report in a summary column, which I believe is not possible,
so it is neccessary to code a 'SELECT' statement to get a distinct count of a column. This can have impact on performance especially at GROUP level.

Does anyone know of an alternative method for counting unique values without coding additional SELECT routines ?

Thanks,
N
 
This has recently been discussed in thread442-725309. There is another way also that I learned after that discussion.
1. Select the field that you need to count distinct TWICE in the select statement, so that you would have two instances of the same field in the data model.
2. In data model, drag one of those columns out of the group it belons upward, so that it would create a new group between existing groups.
3. In the upper group, COUNT the field from the new group. That will distinct count, because groups are created uniquely.

Downside effect of this method is that the field you are counting will get ranged in the report.
 
Thanks Tatips for asking,
I had the same trouble.
Even though I could pass in the Select 2 count distinct emp_id, I needed one emp_id for a sub-query.

Vincent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top