Link to home
Start Free TrialLog in
Avatar of angel7170
angel7170Flag for United States of America

asked on

Bring all records based on a value in Crystal Reports

Hello,

Please see the attached doc for the data that looks like.
I have more than one record for an "Incident Number" as you see in the doc.
I have a group based on Incident Number.
What I need is, If an "Incident Number" is affected by Assigned Group 2 =  "NPC" value then bring all the records related to that Incident Number. So basically I want to see all 4 records for the Incident Number - INC000000057860 and ignore the other records.
Please assist.

Thank you so much
Avatar of Marcus Aurelius
Marcus Aurelius
Flag of United States of America image

Nothing attached...?
So have you tried using SELECT EXPERT....???

{Assigned Group 2} =  "NPC"
Avatar of angel7170

ASKER

Oops Sorry!
Here is the attachment

Also, I did tried using the SELECT EXPERT and it just brings the records that is equal to NPC but the not the other records related to that Incident Number.

Thank you


open-incidents-based-on-initial-.doc
Avatar of Mike McCracken
Mike McCracken

Will NPC always be on the first record or sould it be on any of the detail records?

mlmcc
NPC will be the first record. Thank you
Try this

Riight click the group header in the left margin
Click SECTION EXPERT
Click the formula button to the right of SUPPRESS
WhielPrintingRecords;
Global BooleanVar SuppressSection;
SuppressSection := {NPCFiled} <> 'NPC'
SuppressSection

Click SAVE & CLOSE

Click the DETAIL SECTION
Click the formula button to the right of SUPPRESS
WhielPrintingRecords;
Global BooleanVar SuppressSection;
SuppressSection

Unless you need the group footer suppress it

mlmcc
Thank you so much.

This works!
But now I am asked to do some more.

To calculate the time difference, when an Incident Number is changed from  NPC to a different group like "2199" or some thing like.
I created two formulas to do it as below.

But I couldn't do a SUMMARY using this formula. I want to calculate the average time it took to change from one group to another.
Can you please help.
So far you guys have been a great help. Thank you again!




@TimeDifference
 
if {HPD_Search_Assignment_Logs.Incident_Number} = next({HPD_Search_Assignment_Logs.Incident_Number}) then
(Datediff("n",{HPD_Search_Assignment_Logs.Submit_Date2},next({HPD_Search_Assignment_Logs.Submit_Date2}))/60
 
 
@Time Value for NPC
 
if {HPD_Search_Assignment_Logs.Assigned_Group_2} = "NPC" and
 next({HPD_Search_Assignment_Logs.Assigned_Group_2}) like "*99*" then {@TimeDiffernce}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This works perfect. That is exactly what I need. Thank you so much