Print Page | Close Window

Distinctcount filtering

Printed From: Crystal Reports Book
Category: General Information
Forum Name: Announcements
Forum Discription: Please check this section for the latest announcements from Crystal Reports Forum
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3330
Printed Date: 17 May 2024 at 9:55pm


Topic: Distinctcount filtering
Posted By: Audleyite
Subject: Distinctcount filtering
Date Posted: 04 Jun 2008 at 4:07am
I've set up a distinct count field to display on the report which works fine, but I want to filter the report to only display where the count is 2 or more.  I can't seem to find how to achieve this using Crystal Reports 10.  Can anyone help please?

-------------
SMT



Replies:
Posted By: jkwrpc
Date Posted: 10 Jun 2008 at 9:04am
I am not clear as to how you set up the count.
 
If you are doing it in SQL you can change your query to include a 'Having' statement which kind of acts like a 'Where' statement for Group By.
 
You could create a formula or series of formula that checks the count by using an IF statement
 
If 'distinct count' > = 2 then .....
 
If the SQL query is something that will work for your needs it is in my humble opinion the better solution.
 
Hope this is of some help.
 
Regards,
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net
 


Posted By: pandabear
Date Posted: 24 Jun 2008 at 11:04am

Go to the section(s) , click on the formula button next to

"Suppress" and enter "distinct field that I created" <= 2.
Repeat for each section you need to hide.
(SQL almost always better :)


Posted By: Audleyite
Date Posted: 25 Jun 2008 at 8:50am
Thanks very much guys for all your help!  Much appreciated!

-------------
SMT



Print Page | Close Window