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

Filtering Group based on string value 2

Status
Not open for further replies.

bnsSteve

Technical User
May 3, 2010
94
CA
Hi there,

I have a bunch of customer ID's that lists their account #'s along with the product code.

I'm grouping by Customer ID and would like to filter out the group if that customer holds a specific product.

I.,e

GH1 - 123
123 - 3214 - ABC
123 - 4567 - CTE
123 - 4581 - SER
GH1 - 456
456 - 4842 - TDE
456 - 5482 - QSW
456 - 5812 - KOD

So I would like if I could filter out Groups(Cust.ID's) that hold prod.code CTE. In this instance Group "123" would be removed and "456" would remain.

Thanks!

Running Crystal 11 - 14.0.2.364
 
create formula

//@formula
if {prod_code} in ["CTE"] then 1

in suppression field for Group header, footer and detail

add

sum(@formula},{cust.id}) > 0

_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

 
Thanks for the reply CoSpringsGuy,

Is there a way to suppress the details along with the group header? Currently it just suppresses the group header (cust.id) and the details get lumped in with the preceding group.

Running Crystal 11 - 14.0.2.364
 
in suppression field for Group header, footer AND detail

add

sum(@formula},{cust.id}) > 0

_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

 
OK I found it, forgot that I should of suppressed the details section.

Your solution works great.

Thanks CoSpringsGuy!

Running Crystal 11 - 14.0.2.364
 
Thanks again!

Running Crystal 11 - 14.0.2.364
 
Group selection is simpler. Go to report->selection formula->GROUP and enter:

sum(@formula},{cust.id}) = 0

...and you can use running totals across groups and still get the correct results without adding any special criteria.

-LB
 
your welcome .. fyi - another solution would be instead of suppression .. go to group selection and use this same formula.
sum(@formula},{cust.id}) = 0

Could be useful if you will be doing certain calculations or running totals on your data

_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

 
timestamp to the second!

_____________________________________
Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection

 
Thanks for the tips! Going to try that solution instead.

Running Crystal 11 - 14.0.2.364
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top