×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Derived Field or Macro
2

Derived Field or Macro

Derived Field or Macro

(OP)
Hello,

First off, our company utilizes PCPW 5.1, and Reportsmith ver 4.2 (oracle)

Being a new user, I've searched the forum to verify if my question has already been posted.  There are a couple that are similar but not exactly what I'm looking for.

I'm hoping someone can assist.  I've created a report that has a derived filed to calculate Length of service ("LOS").  "LOS" results in Years and Months.  I'm trying to create another derived field that will compare the results and give a value based on an annual maximum.  e.g., If "LOS" is 0-5 years, then give 25 days, if "LOS" is 6-10 years, then give 37.5, if "LOS" is >10 years, then give 50 days.

I am open for suggestions.

Thank you in advance.

RE: Derived Field or Macro

2
Give this a try:

CASE
WHEN TRUNC(MONTHS_BETWEEN(SYSDATE,"PS_EMPLOYMENT"."HIRE_DT") / 12) < 6 THEN 25
WHEN ((TRUNC(MONTHS_BETWEEN(SYSDATE,"PS_EMPLOYMENT"."HIRE_DT") / 12) > 5) AND (TRUNC(MONTHS_BETWEEN(SYSDATE,"PS_EMPLOYMENT"."HIRE_DT") / 12) < 10)) THEN 37.5
WHEN TRUNC(MONTHS_BETWEEN(SYSDATE,"PS_EMPLOYMENT"."HIRE_DT") / 12) > 10 THEN 50
END   

YOU WILL NEED TO CHANGE "PS_EMPLOYMENT"."HIRE_DT" to the PCPW FIELD NAME.  I put this together on a enterprise system not a PCPW system.

CharlesCook.com
ADP - PeopleSoft - SAP
ReportSmith - Crystal Reports - SQR - Query - Access
Reporting - Interfaces - Data Mining

RE: Derived Field or Macro

(OP)
Charles,

Thank you for the quick reply.  Yes, I too am more familiar with ReportSmith under the ADP Enterprise application.

I will attempt to utilize your suggestion and post my results if successful.

Thank you,

RE: Derived Field or Macro

I think the part in bold red is incorrect:

CASE
WHEN TRUNC(MONTHS_BETWEEN(SYSDATE,"PS_EMPLOYMENT"."HIRE_DT") / 12) < 6 THEN 25
WHEN ((TRUNC(MONTHS_BETWEEN(SYSDATE,"PS_EMPLOYMENT"."HIRE_DT") / 12) > 5) AND (TRUNC(MONTHS_BETWEEN(SYSDATE,"PS_EMPLOYMENT"."HIRE_DT") / 12) < 10)) THEN 37.5
WHEN TRUNC(MONTHS_BETWEEN(SYSDATE,"PS_EMPLOYMENT"."HIRE_DT") / 12) > 10 THEN 50
END

CharlesCook.com
ADP - PeopleSoft - SAP
ReportSmith - Crystal Reports - SQR - Query - Access
Reporting - Interfaces - Data Mining

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close