[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Grouping / Record Selection Question for Crystal Reports XI

Posted on 2011-10-27
9
Medium Priority
?
270 Views
Last Modified: 2012-05-12
Hello Experts,

I am working on a Crystal Report (version XI) that queries an Oracle database and is grouped by the following fields:

Court Date (for each day)
Judge Name
Case Number
Charge Number

The report is run for a date range that covers several months, so case numbers appear on the report multiple times if there are multiple court dates/judges for a single case number within the report date range. I'm wondering if there is a way, while maintaining the current grouping, to display case numbers only once for the most recent court date.

Additionally...I don't know if this is relevant to my question above...but the report is only displaying cases in which specified fields have null values. This is accomplished by using the following formula:

numberVar Nulls;
if (isnull({PTYCHRG.DCSN_CD}) and isnull({PTYCHRG.DCSN_DT})
and isnull({PTCGDSP.DSP_DT}) and isnull({PTCGDSP.CG_DSP_CD}))
then Nulls := 0
else Nulls := 1

and then using the following group selection statement to suppress records:
Sum ({@Nulls}, {CASE.DSCR}) = 0

Thank you!!

0
Comment
Question by:jsmith08
8 Comments
 
LVL 1

Accepted Solution

by:
SarekOfVulcan earned 1000 total points
ID: 37041656
Check out the Oracle Analytic Functions. You could write a SQL Command looking something like:

select * from (
    select date
        , max(date) over (partition by judge_name, case_number, charge_number) as max_date
) where date=max_date
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 37042539
Are you looking to show the case only for the last activity?

Do you need the information from the rest of the case for summaries or other analysis?

mlmcc
0
 

Author Comment

by:jsmith08
ID: 37045667
I need the report to group by the court date and Judge for the last court date available in the database for the case.  I don't need any other court date and Judge information.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:jsmith08
ID: 37045683
The other charge information that I'm using in the report will be the same regardless of the court date and Judge.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 37045929
Have you tried using the Group Select with  TOP 1 based on the date?

mlmcc
0
 

Author Comment

by:jsmith08
ID: 37047419
No, I have not tried that yet.  I'll see how that works.
0
 
LVL 19

Assisted Solution

by:GJParker
GJParker earned 1000 total points
ID: 37057914
You could try creating a SQL Expression, I'm not good on oracle syntax but it woudl be something like

%MaxCourtDate
(
select maximum(A.court_date)
from table A
where A.case_number= table.case_number
)

you can then add this to your record selection formula to filter the correct records i.e.

table.court_date = {%MaxCourtDate}

HTH
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 37205962
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question