0
Jul 07, 2020 at 02:26 PM

# Calculating Social Security Taxes in BPC for Planning

42 Views

We are beginning a project to forecast social security taxes in BPC NW 10.1 at an employee level. When attempting to use Logic Scripts to do these calculations we have found it to be very difficult to stop the calculations when the employee reaches the annual maximum amount. We have found examples where we can calculate YTD values, however, to stop the calculation at the maximum annual value seems very difficult or even impossible. Has anyone had any success with this? If not, what solutions were found to be helpful for this calculation.

Below is the script we are using to calculate the YTD values:

*SELECT(%Y%,[YEAR],TIME,[ID]=2020.TOTAL) //%Y% - will contain 2007

*SELECT(%M01%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=1 AND [CALC]=N)

*SELECT(%M02%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=2 AND [CALC]=N)

*SELECT(%M03%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=3 AND [CALC]=N)

*SELECT(%M04%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=4 AND [CALC]=N)

*SELECT(%M05%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=5 AND [CALC]=N)

*SELECT(%M06%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=6 AND [CALC]=N)

*SELECT(%M07%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=7 AND [CALC]=N)

*SELECT(%M08%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=8 AND [CALC]=N)

*SELECT(%M09%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=9 AND [CALC]=N)

*SELECT(%M10%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=10 AND [CALC]=N)

*SELECT(%M11%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=11 AND [CALC]=N)

*SELECT(%M12%,[ID],TIME,[YEAR]=%Y% AND [MONTHNUM]=12 AND [CALC]=N)

*XDIM_MEMBERSET HR_ACCOUNT AS %PAY_FACTORS% = BAS(BPC_TOTAL_PAY), BAS(BPC_BONUS)

*XDIM_MEMBERSET MEASURES = PERIODIC

*XDIM_MEMBERSET EMPLOYEE = ##EMPLOYEENUMBER###

*XDIM_MEMBERSET TIME = BAS(2020.TOTAL)

*XDIM_MEMBERSET AUDIT_TRAIL = INPUT

*WHEN HR_ACCOUNT

*IS %PAY_FACTORS%

*WHEN TIME.MONTHNUM

*IS 1

*REC(EXPRESSION=%VALUE%,TIME=%M01%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M02%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M03%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M04%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M05%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M06%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M07%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M08%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M09%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 2

*REC(EXPRESSION=%VALUE%,TIME=%M02%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M03%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M04%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M05%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M06%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M07%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M08%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M09%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 3

*REC(EXPRESSION=%VALUE%,TIME=%M03%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M04%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M05%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M06%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M07%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M08%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M09%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 4

*REC(EXPRESSION=%VALUE%,TIME=%M04%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M05%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M06%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M07%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M08%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M09%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 5

*REC(EXPRESSION=%VALUE%,TIME=%M05%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M06%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M07%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M08%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M09%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 6

*REC(EXPRESSION=%VALUE%,TIME=%M06%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M07%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M08%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M09%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 7

*REC(EXPRESSION=%VALUE%,TIME=%M07%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M08%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M09%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 8

*REC(EXPRESSION=%VALUE%,TIME=%M08%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M09%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 9

*REC(EXPRESSION=%VALUE%,TIME=%M09%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 10

*REC(EXPRESSION=%VALUE%,TIME=%M10%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 11

*REC(EXPRESSION=%VALUE%,TIME=%M11%,HR_ACCOUNT=SS_TAX)

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*IS 12

*REC(EXPRESSION=%VALUE%,TIME=%M12%,HR_ACCOUNT=SS_TAX)

*ENDWHEN

*ENDWHEN