Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: selecting records for the latest date Post Reply Post New Topic
Author Message
judylynn
Newbie
Newbie
Avatar

Joined: 17 Nov 2008
Location: United States
Online Status: Offline
Posts: 22
Quote judylynn Replybullet Topic: selecting records for the latest date
     Posted: 01 Feb 2012 at 4:26am
I'm trying to select records from a Family ID group based on the most recent Intake Date from a Risk assessment Table.
Then I want to show the Risk Assessment that corresponds to the most recent intake Date.
 
I've grouped the report on Family ID from the EnrolledTable. Then I created a formula and inserted in the group:
 
Maximum({Risks_all_customers.Intake/Received},{enrolled_11_1_unduplicated.Family ID})
 
 
It is returning the most recent intake date, but then when I add the Risk Assessment Field (returns High, Medium, or Low), it's not showing me the risk level that corresponds to that date.
I suspect this has something to do with evaluation time and I've played around with that a little with no success.
Please help!
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 01 Feb 2012 at 5:57am
try adding a
sort by {Risks_all_customers.Intake/Received} descending

IP IP Logged
judylynn
Newbie
Newbie
Avatar

Joined: 17 Nov 2008
Location: United States
Online Status: Offline
Posts: 22
Quote judylynn Replybullet Posted: 01 Feb 2012 at 7:12am
This does seem to be working. Can you explain to me why it works?
Thanks!
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 01 Feb 2012 at 9:56pm
When you place an field with multiple records in a section which can't display them all (ie not the details section) the first entry will be displayed.
 
Maximum({Risks_all_customers.Intake/Received},{enrolled_11_1_unduplicated.Family ID})
 
Will make them all records show the max date, so that will be displayed in the first record. However any other fields will still be shown in the original order.
 
Sorting the data so the latest record is at the top of the record list means the fields corresponding to the maximum date will be displayed.
 
Hope that clears that up for you.
 
Regards,
Ryan.
IP IP Logged
judylynn
Newbie
Newbie
Avatar

Joined: 17 Nov 2008
Location: United States
Online Status: Offline
Posts: 22
Quote judylynn Replybullet Posted: 02 Feb 2012 at 2:55am
Thanks! I just wanted to be sure I could trust it to always work - sounds like it will!
IP IP Logged
Babea
Newbie
Newbie
Avatar

Joined: 07 Mar 2012
Location: United States
Online Status: Offline
Posts: 12
Quote Babea Replybullet Posted: 13 Mar 2012 at 3:57pm
Hi, I am trying to do something similar with a twist.

I am trying to get the most recent hearing date that is sorted by the current hearing officer. I am also trying to sort by age, so I can help prevent them from becoming late.

Hearing Officer
Client ID
Appeal # (1 to many)
Hearing #(can be many if rescheduled = R)
Hearing Date = should be currentdate-1 for this report.
Timely = less than 30 days unless there is an R or an exception - then it is timely if done within 90 days.

I have tried to give all the fields and as much info as possible to help solve my issue.

I have the timely formula for 90 days with R or exception, but I have hearings pop that are untimely with an O that have not been rescheduled.

Thanks for your help. Babea
Thanks! Babea
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum