Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Evaluating the Detail Line 1

Status
Not open for further replies.

winterjl

IS-IT--Management
Aug 16, 2004
4
US
I am using Crystal 9.0 and would like to print out the latest information for an employee and their pay rate when a particular Reason Code is displayed. I am grouping off of the employee. The output currently looks like:

Employee Name
Effective Date New Pay Rate Reason
Effective Date New Pay Rate Reason
Effective Date New Pay Rate Reason

Actual Data:

Jenni Smith
01/05/2003 15.96 New Hire
06/10/2004 16.10 PRN-C
08/15/2004 16.16 Market
01/28/2005 17.00 PRN-A

What I need to capture and display is the last time the Reason is PRN and the date that corresponds with that detail line.

Any help would be great. Thanks.
 
Try creating a formula {@PRNdate}:

if {table.reason} startswith "PRN" then {table.date}

Then insert a maximum on the formula. If you want the entire line to display, and ONLY this line, then go to report->edit selection formula->GROUP and enter:

{table.date} = maximum({@PRNdate},{table.employee})

-LB
 
That worked perfect! Here is my next project. Same topic. Would it be possible to pull the previous wage amount prior to the last PRN entry? So in the example above I would want to show the 16.16 amount for the employee. Thanks for all your help.

Jenni
 
Assuming you did not use the group selection approach, but instead just inserted the maximum on the formula, you could create another formula:

if {table.date} = maximum({@PRNdate},{table.employee}) and
{table.employee} = previous({table.employee}) then
previous({table.payrate})

-LB
 
That worked perfect. I can't tell you how much you have helped me. Thanks so much.

Jenni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top