cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

pcr payroll

sapuser0982
Explorer
0 Likes
995

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.  

 

Accepted Solutions (1)

Accepted Solutions (1)

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

 

sapuser0982
Explorer
0 Likes
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 Likes

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
Contributor
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.
sapuser0982
Explorer
0 Likes
Thankyou corriveau_remi, very well explained.

Answers (1)

Answers (1)

corriveau_remi
Contributor

Additional information:

At the beginning of a Schema, it is wise to add a PCR that will clear out all temporary variables that will be created in that schema, specially if it could make a loop, using Operation ZERO=&XXXX followed by ZERO=&YYYY, ZERO=&ZZZZ and so on)

Using a Constant (from V_T511K) instead of using a number enables you to change the value over time without having to delimit your PCR and create a new node in it.  Maybe in a year or three the comparison will not be with 50,000 but with 45,000 or 60,000.  It's easier to change the value of a constant than to change a PCR.