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

Suppress Entire Group 2

Status
Not open for further replies.
Jul 23, 2002
26
Hi Guys,

First I'm using Crystal 8.5 and I'd like to suppress an entire group based on a formula. I'm not sure how to do this, do I use the selection expert or do I use the group select expert?

I am trying to find customers who have not used our services within the past year. So I have all the services they have used listed in the detail section, for example:
CustID ServDate
00156 8/10/04
00156 9/5/03
00156 8/21/03
00235 1/16/03

And I have a formula that evaluates the dates and returns 2 if the service date is within a year and 1 if the service date is older than a year so the report looks like this:
CustID ServDate @formula
00156 8/10/04 2
00156 9/5/03 2
00156 8/21/03 1
00235 1/16/03 1

What I need now is a way to only display the customers that have a 1 and nothing else. so I tried a select expert of @formula =1 and What I'm getting now is something like this:
CustID ServDate @formula
00156 8/21/03 1
00235 1/16/03 1

But what I need is this:
CustID ServDate @formula
00235 1/16/03 1


I'm sorry if this seems confusing but I have not been able to figure this one out. Any help would be greatly appreciated.
 
First group on {table.custID} and then change your formula to something like the following, which I'll call {@withinyr}:

if {table.date} > currentdate - 365 then 1 else 0

Then go to report->edit selection formula->GROUP and enter:

sum({@withinyr},{table.custID}) = 0

This will return only those customers who have not received services in the last year. For further calculations, you will need to use running totals, since non-group selected records will contribute to the more usual summaries.

-LB
 
Amend that a bit:

{@withinyr}:
if {table.date} > datadd("y",-1,currentdate) then 1 else 0

The previous formula won't allow for leap years.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top