cancel
Showing results for 
Search instead for 
Did you mean: 

pcr payroll

farna
Explorer
0 Kudos
367

Hi experts,

Please help. Im new to PCR and learning the basics. 

I need to write a PCR to read amount from a certain wage type (ex: WT 1000) in input table and multiply it with the number of any other wage type(ex: WT 1001) and store in WT1000. if the amount is greater than 50,000 then add it to output table. 

*

****

1001

ADDWT&NUM

ADDWT*

1000 

ADDWT&AMT

MULTI NAA

ADDWT *

AMT>50000

ADDWT*

i wrote this and it doesnt work.  

 

View Entire Topic
sikindar_a
Active Contributor

You have to write Two PCRS and they should be as per below 

1001

ADDWT*

ADDWT&NUM

1000 

NUM=&  NUM

MULTI NAA

ADDWT *

Write the above two PCRs and revert with your results here we will go to the next one once you achieve the above one

Here Number from WT 1000 will be multiplied with Amount in WT 1001  , Ensure you have inserted the PCR with PIT and check the output of each PCR.

DM me in case of any issue

 

farna
Explorer
0 Kudos
thankyou.. on what basis do we decide of we need one pcr or two? only one wagetype should be in one pcr?
sikindar_a
Active Contributor
0 Kudos

By mistake i close the thread apologies and coming to your query 

1. Experience Teaches us 2. you need values of one wage type to be queried for the output of another wage type hence results should exists in the output table first then only we can go ahead with the second condition

 

corriveau_remi
Active Participant
If you run a Payroll Simulation for one employee, with the "Display Log" box checked, you will be able to drill down into your schema and look at what happens when a PCR is called by function PIT. In the Input Table to your PCR, the entries are sorted first by ESG and then by WT (in ascending order). The entries will be processed in that Order, and WT 1001 will be processed after WT 1000 if both have the same ESG split, and even if the appear in the reverse order in the IT, if both WTs do not share the same splits it is often impossible to read the values of the other WT. Therefore, a first PCR will often be created to transfer into a temporary variable the values of a WT (using Opeartion ADDWT&1001). Then, in the second PCR where you will process WT 1000 specifically, you will then use the following Operations in sequence: NUM=& 1001 MULTI NAA AMT?KZ50K (where Z50K is a constant in table T511K with a value of 50000) and if the result is > use Operation ADDWT * but if it is anything else ( *, or = and <) then do nothing WT 1000 will disapear from the output table.
farna
Explorer
0 Kudos
Thankyou corriveau_remi, very well explained.