Hello.
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:
*CALC_EACH_PERIOD
*XDIM_MEMBERSET TIME=%YEAR%.JAN,%YEAR%.DEC
*XDIM_MEMBERSET DATASRC=INPUTORLOAD
*XDIM_MEMBERSET CATEGORY=Budget
*XDIM_MEMBERSET PAYACCOUNT="HEADCOUNT"
*XDIM_MEMBERSET SCENARIO <> BASELINE
*XDIM_MAXMEMBERS ORGANIZATION = 300
*OLAPLOOKUP PAYROLL
*DIM BASESAL:PACCOUNT="SALARY"
*DIM BASESAL:JOB = JOB
*DIM BASESAL: POSITION = "P_TOTCO"
*DIM BASESAL: SCENARIO="BASELINE"
*DIM BASEHDS:PACCOUNT="HEADCOUNT"
*DIM BASEHDS:JOB=JOB
*DIM BASEHDS:POSITION = "P_TOTCO"
*DIM BASEHDS:SCENARIO="BASELINE"
*ENDLOOKUP
*WHEN SCENARIO
*IS <>"BASELINE"
*WHEN PAYACCOUNT
*IS "HEADCOUNT"
*REC(PAYACCOUNT="SALARY",POSITION="P_NOPOSITION",EXPRESSION = %VALUE% * LOOKUP(BASESAL) / LOOKUPBASEHDS))
*REC(PAYACCOUNT="HEADCOUNTFTE",EXPRESSION = %VALUE%)
*ENDWHEN
*ENDWHEN
*COMMIT