Solved

Bring all records based on a value in Crystal Reports

Posted on 2009-04-03
9
208 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:angel7170
  • 4
  • 3
  • 2
9 Comments
 
LVL 17

Expert Comment

by:MIKE
ID: 24061706
Nothing attached...?
0
 
LVL 17

Expert Comment

by:MIKE
ID: 24061725
So have you tried using SELECT EXPERT....???

{Assigned Group 2} =  "NPC"
0
 

Author Comment

by:angel7170
ID: 24061799
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
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 100

Expert Comment

by:mlmcc
ID: 24062368
Will NPC always be on the first record or sould it be on any of the detail records?

mlmcc
0
 

Author Comment

by:angel7170
ID: 24062560
NPC will be the first record. Thank you
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24062930
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
0
 

Author Comment

by:angel7170
ID: 24063664
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

0
 
LVL 100

Accepted Solution

by:
mlmcc earned 125 total points
ID: 24063754
You can't do a summary because summaries are done in the Reading Pass through the report and the NEXT function must run in the last pass through the report.

What you will have to do is do a manual total

@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
else
    0
 
 
@Time Value for NPC
 WhilePrintingRecords;
Global NumberVar TotalTime;
Global NumberVar ChangeCount;
LocalNumberVar ThisTimeDiff;

if {HPD_Search_Assignment_Logs.Assigned_Group_2} = "NPC" and
 next({HPD_Search_Assignment_Logs.Assigned_Group_2}) like "*99*" then
(
    ChangeCount := ChangeCount + 1;
   ThisTimeDiff := {@TimeDiffernce};
   TotalTime := TotalTime + ThisTimeDiff;
   ThisTimeDiff
)

Add a formula to the report header
 WhilePrintingRecords;
Global NumberVar TotalTime;
Global NumberVar ChangeCount;

Add a formula to the report footer for the average
 WhilePrintingRecords;
Global NumberVar TotalTime;
Global NumberVar ChangeCount;
If ChangeCount = 0 then
   0
else
   TotalTime / ChangeCount

mlmcc
0
 

Author Comment

by:angel7170
ID: 24086637
This works perfect. That is exactly what I need. Thank you so much
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

786 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