Solved

Bring all records based on a value in Crystal Reports

Posted on 2009-04-03
9
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mask on Parameter CR2008 28 80
Crystal Reports Date Calculation 10 52
free Crystal Report viewer 4 45
Selecting records Crystal Reports 8 15
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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

732 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