Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Performance Management
Lawson Business Intelligence/Reporting/Crystal
Employee work history report
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Saef
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5226
People Online:
Visitors:
422
Members:
0
Total:
422
Online Now:
New Topics
S3 Systems Administration
ADFS certificate - new cert
12/3/2024 9:38 PM
The certificates on the windows boxes expired and
Lawson S3 HR/Payroll/Benefits
Post Tax Benefit Plan Table
11/14/2024 9:16 PM
Hi, totally new to Laswon. I have a repor
Lawson S3 Procurement
ED501 Error: Map 850 not supported by /law/c15vda/lawson/test10/edi/bin/laws_out_91
11/12/2024 3:47 PM
Tried runnning ED501 and getting the atathced erro
Lawson S3 HR/Payroll/Benefits
Error
11/6/2024 9:54 PM
When I try to enroll a retiree in 72.1 health plan
Infor ERP (Syteline)
Syteline: New Data Maintenance Wizard (Error) Need help
11/1/2024 4:24 PM
Hi, I need help with an error on syteline while us
Dealing with Lawson / Infor
Implementing Lawson v10 with Cerner Surginet, Case Cart Picking, and Quick Adds for the OR
10/29/2024 4:20 PM
Hi Everyone, I am wondering if there is any org
Lawson S3 HR/Payroll/Benefits
Canada Tax Calculation (Federal and Provincial) Issue
10/23/2024 5:00 AM
Initially, we had problem with CPP2 calculation is
Lawson S3 HR/Payroll/Benefits
CA Section 125 401k Plan
10/22/2024 10:13 PM
Does anyone have any recommendations on how to fac
S3 Systems Administration
Running AC120 deleted records from ACMASTER table
10/22/2024 3:40 PM
We recently ran the AC120 as normal and somehow it
Lawson S3 Procurement
RQ13 Approval Info
10/17/2024 2:12 PM
When a Requisition is approved on RQ13, what table
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3291
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1372
Roger French
1315
mark.cook
1244
Forums
Filtered Topics
Unanswered
Unresolved
Announcements
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Performance Management
Lawson Business Intelligence/Reporting/Crystal
Employee work history report
Please
login
to post a reply.
11 Replies
3
Subscribed to this topic
22 Subscribed to this forum
Sort:
Oldest First
Most Recent First
Author
Messages
Lance Jurgensen
Advanced Member
Posts: 36
9/9/2015 4:50 PM
Hello,
New to Lawson and learning the data on the fly. HRHistory is a bit of a conundrum for me yet.
I am trying to write SQL for a crystal report that will report a chronological history of an employees work history from Lawson. Similar to the PA340 Action History Listing but with more useful information :-)
Basics such as Name, Employee#, position, position description, FTE, supervisor, job code, status, date effective for all positions an employee has held.
Would be grateful for any help or pointers...
The.Sam.Groves
Veteran Member
Posts: 89
9/9/2015 5:30 PM
That's sort of been my holy grail that I've been searching for time for to develop on my own.
So I can't share a complete solution for you but I can give you a couple of tips on how the data is stored.
HRHISTORY stores a row for each field changed as long as that field is marked as 'history enabled'.
FLD_NBR corresponds to number of the field that was changed.
Lawson hard coded fields are stored in PDICT if you need to look up the name of the field.
User defined fields are represented by adding 2000 to the actual field_key value (e.g. if you have a user field that was assigned a key of 99 then on HRHISTORY it'll show as 2099), and the definitions for them are stored in HRUSERFLDS.
Both PDICT and HRUSERFLDS contain a FIELD_TYPE column which will define for you which *_VALUE field in HRHISTORY actually contains the new value of the field being changed.
If the change was caused by a personnel action (i.e. PA52.1 or any of its compatriots) then ACT_OBJ_ID will store the OBJ_ID value of the row that stores that action's information in PERSACTHST.
The old value of the field is NOT stored anywhere on the row. To determine that you have to essentially look for a row with the highest BEG_DATE/DATESTAMP combo for the same employee and field and use the value from that row. Checking the date stamp is essential as otherwise you'll get retroactive changes listed out of order on your report.
If such a row doesn't exist, then either your current row is the first time the field was set to a value or the first time it's been changed since history for the field was enabled.
Needless to say, a replacement for PA340 or HR105 would be difficult to create in a pure SQL environment, especially given the amount of data you'll need to sift through if your organization has been using Lawson for any length of time as this is one of the tables whose size grows geometricly with the amount of activity you have. Almost any personnel action you'd submit will result in multiple rows being added to the table.
John Henley
Posts: 3353
9/9/2015 6:04 PM
I have this, as well as some alternative approaches...
https://www.lawsonguru.co...2947/category=854096
The.Sam.Groves
Veteran Member
Posts: 89
9/9/2015 6:33 PM
John, might be on my side, but your link doesn't seem to work for me. I get a 'blank' LawsonGuru page when following it. Picture attached.
Attachments
2015-09-09 14_31_37-LawsonGuru.com _ Store.png
Lance Jurgensen
Advanced Member
Posts: 36
9/9/2015 6:41 PM
Thanks, I was able to see it. I will take a look, I didn't know there was a "Store" !
Lance Jurgensen
Advanced Member
Posts: 36
9/9/2015 6:42 PM
Thank you, very informative. I'm plugging away at it, it will be for a single employee so there won't be "that" much data...
John Henley
Posts: 3353
9/9/2015 6:43 PM
Lance, what database are you using?
Lance Jurgensen
Advanced Member
Posts: 36
9/10/2015 6:29 PM
Oracle DB
John Henley
Posts: 3353
9/14/2015 11:07 AM
Here are some samples
Attachments
persacthist1.png
persacthist2.png
Lance Jurgensen
Advanced Member
Posts: 36
9/24/2015 5:25 PM
I have attached my sample along with the SQL I used to get there. With testing it seems to be accurate, but I am finding there are not always history records with the field number I am looking for. I have used the paemppos and persacthst tables instead of the hrhistory table for the most part. Query needs some tuning as it runs fairly slow at 20-30 seconds but it gets me what I want for the most part.
I could use help getting:
employee status at the time of the position change, currently using fld_nbr 728 in hrhistory
total fte at the time of the position change, currently using fld_nbr 20 in hrhistory
Attachments
lawson_guru_work_history.txt
lawson_guru_work_history.png
maalimsimo
Veteran Member
Posts: 49
5/17/2019 6:23 PM
I have found this page in my search for a solution for a 'before' and 'after' situation for some action codes e.g. Address or Status in sql. I can get the 'after' value alright, but I am having a challenge reporting on the 'before' value on the same report record/line.
Any help would be highly appreciated.
- Maalim
Dave Curtis
Veteran Member
Posts: 136
5/17/2019 6:33 PM
The answer would really depend on where you want to pull the history from and exactly what you are looking for, but, here is a quick SQL query that pulls from the position history (PAEMPPOS) table and gives you the record value and the previous value for some of the fields.
The following assumed you use Oracle as your database. Not sure it will work as is if you have MS SQL database.
SELECT employee
,position
,LAG(position,1) OVER(PARTITION BY employee ORDER BY company,employee,pos_level,position,effect_date) as prev_position
,pos_level
,fte
,LAG(fte,1) OVER(PARTITION BY employee ORDER BY company,employee,pos_level,position,effect_date) as prev_fte
,effect_date
,end_date
,job_code
,LAG(job_code,1) OVER(PARTITION BY employee ORDER BY company,employee,pos_level,position,effect_date) as prev_job_code
,pay_grade
,LAG(pay_grade,1) OVER(PARTITION BY employee ORDER BY company,employee,pos_level,position,effect_date) as prev_pay_grade
,date_stamp
FROM paemppos
ORDER BY company,employee,pos_level,position,effect_date
Please
login
to post a reply.