Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Summary of duplicate record Post Reply Post New Topic
Author Message
Dogz
Newbie
Newbie


Joined: 01 Jul 2012
Location: Australia
Online Status: Offline
Posts: 2
Quote Dogz Replybullet Topic: Summary of duplicate record
     Posted: 01 Jul 2012 at 11:20pm

Hi all,

I'm stuck on a report. I cannot change the source report data and want create summary data.

The report data is only basic employee data from an ERP system.

Basically I have

Employee, Payroll date, idle time, Payhours

My problem is I can have a number of idle time records for 1 day

eg.

Emp123,1/7/2012,5.5,5.83

Emp123,1/7/2012,.33,5.83

Emp123,2/7/2012,.23,5.00

Emp123,3/7/2012,.33,6.83

Emp123,3/7/2012,1.43,6.83

 

 

I have created a group at employee level and date. I want to create a summary for each employee with idle time vs. pay hours

 

Because of the duplicate records I get the incorrect results for pay hours, I have tried in the date group level to count the record for each day and divide by the summary of pay hours to give me a correct daily time but I cannot summarize this field to employee group level.

 I hope this makes sense any help would be appreciated

IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 02 Jul 2012 at 4:49am
I would use formulae to manually increment the idle time and pay hours over each detail record and do the summary in the group footer.
You have to remember to reset the counts/sums to 0 in the employee group header.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 02 Jul 2012 at 4:58am

You could try using a running total to get the total for your employee.  It would look something like this:

 
Field To Summarize:  Your PayHours field.
Evaluate:  Use formula.  The formula will look something like this:
 
{MyTable.Employee} <> Previous ({MyTable.Employee}) and
{MyTable.PayrollDate} <> Previous({MyTable.PayrollDate}
 
Reset: On Change of Group - Your employee group.
 
-Dell
 
 
 
IP IP Logged
Dogz
Newbie
Newbie


Joined: 01 Jul 2012
Location: Australia
Online Status: Offline
Posts: 2
Quote Dogz Replybullet Posted: 02 Jul 2012 at 8:40am
I had something like that but don't know how to do the running total and reset
 
if {BAQReportResult.LaborHed.PayHours} = previous({BAQReportResult.LaborHed.PayHours}) then 0 else {BAQReportResult.LaborHed.PayHours}
 
would this formula work the same?
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 02 Jul 2012 at 10:13am
No, because Crystal won't let you do a summary on a formula that uses Previous() or Next().
Take a look at what I wrote - you need to create a New Running Total in the Field Explorer.  When you do this you'll see a form that has a place for entering all of the information I gave you in my previous post.
 
-Dell
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