Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

Crystal Reports XI record selection question

Hello Experts,

I am working on a Crystal Report (version XI) that queries an Oracle database and displays
the following database fields:
case number, charge number, charge description, and charge disposition. For example:

2011 ABC 123456
1       LICENSE REQUIRED TO OPERATE       GUILTY
2       DRIVER SEAT REQUIRED            NOLLE
3      DISPLAY OF PLATES;FICTITIOUS

2011 DEF 654321
1       LICENSE REQUIRED TO OPERATE       NOLLE
2       DRIVER SEAT REQUIRED            NOLLE
3       DISPLAY OF PLATES;FICTITIOUS      NOLLE

The report is grouped by case number then charge number. I am trying to figure out a way to
display only cases in which all charges have a charge disposition value of "NOLLE" as in
case 2011 DEF 654321. There can be a varying number of charge numbers and various charge
dispositions. There can also be null values for the charge disposition. I have tried using a
running total field to count the number of "charge numbers" with a reset on each case number
group, and then I created another running total field to count the number of charge
dispositions when the value = NOLLE. My thought was that I could use a statement in the
Group Selection statement to display only cases in which these two running total values are
equal, but that's not working. Any other ideas on how I might be able to accomplish this?

Thanks.
0
jsmith08
Asked:
jsmith08
2 Solutions
 
Haris DjulicCommented:
you can use the suppress option on details and then add the formula to get the charge disposition wanted
i.e.
if charge disposition='NOLLE'
ee-.PNG
0
 
mlmccCommented:
Try thi formula
Name - NotNolle
If IsNull({charge disposition}) then
    1
Else If {charge disposition} <> "NOLLE" then
    1
Else
    0

Use this for the group selection
 Sum({@NotNolle}) = 0

mlmcc
0
 
James0628Commented:
mlmcc's formulas should work.  FWIW, your running total idea was on the right track.  The problem is that running totals are created as the records are processed, so you won't have the totals for a group until you get to the group footer, and it's too late to suppress the group at that point.  mlmcc's suggestion uses a formula with the Sum function, because CR can generate the Sum for a group at the beginning of the group, so you can use that to select which groups to show on the report.

 Also, note that group selection really just suppresses the other groups.  The data in those groups is still read by the report.  Those groups just aren't shown.  If you do any totals outside of that group, like grand totals, they will include all of the suppressed groups.  If you want totals that exclude those groups, you'll need to create them manually using formulas and variables.

 James
0
 
jsmith08Author Commented:
samo4fun's suggestion only suppressed the charges that did not have a NOLLE disposition when what I need is to only show groups in which all charges have a charge disp of NOLLE.  mlmcc's suggestion accomplished what I'm trying to do, and as James0628 noted, I did have to create another formula to get a grand total that doesn't include the suppressed groups.  Thanks everyone for your help!
0
 
James0628Commented:
You're welcome.  Glad I could help.

 James
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now