I am trying to calculate the average salary for individual jobs and use that average in the record statement. My script incorrectly sums all jobs for the average.
Example: We have Headcount in 2 Jobs - 5 in JobA with $10,000 salary and 5 in JobB with $20,000 salary. The value this script returns is the total salary for all employees in both jobA and JObB - $150,000. I want it to return a separate number for Job A ($10,000) and jobB ($20,000). That is, I need the value in BASESAL to be different for each job. The script returns the same number for each job title. What do I need to do to the lookup in order to get the correct amount for each Job?
Here is what I've written:
*XDIM_MEMBERSET SCENARIO <> BASELINE
*XDIM_MAXMEMBERS ORGANIZATION = 300
*DIM BASESAL:JOB = JOB
*DIM BASESAL: POSITION = "P_TOTCO"
*DIM BASESAL: SCENARIO="BASELINE"
*DIM BASEHDS:POSITION = "P_TOTCO"
*REC(PAYACCOUNT="SALARY",POSITION="P_NOPOSITION",EXPRESSION = %VALUE% * LOOKUP(BASESAL) / LOOKUPBASEHDS))
*REC(PAYACCOUNT="HEADCOUNTFTE",EXPRESSION = %VALUE%)