<-----Google Analytics Code Start----> <-----Google Analytics Code Close---->
Skip to content



Default screen resolution  Wide screen resolution  Increase font size  Decrease font size  Default font size  Skip to content Default color Pink color Green color Green color
This website has now moved to http://apps2fusion.com

Fast Formulas in Oracle Payroll | Print |  E-mail
Written by Anil Passi   
Monday, 11 December 2006
In the previous training article, we learnt about Oracle Payroll Balances, via link  
In this article, we continue from previous article to explain Fast Formulas, as a step by step approach.
First, lets recapture some basics from previous article.

We created 3 Elements in Oracle Payroll when Learning about Oracle Payroll Balance.
Element 1 : XX Weekday Lieu Stored
Element 2 : XX Day Off In Lieu
Element 3 : XX Pay from Weekday Lieu Stored

We also created a Balance named "Weekday Lieu balance" with dimension_ASG_ITD using the above three elements.
XX Weekday Lieu Stored : Add
XX Day Off In Lieu : Subtract
XX Pay from Weekday Lieu Stored : Subtract

At the end of the exercise, the Balance left for Weekday Lieu balance was 2.5 hours.

In this article, we will expand upon that article, and demonstrate how to develop Fast formulas.

Lets assume the below business scenario:-
An employee working extra hours during weekends/bank holidays can equate to 1.5 times their Normal Hourly Rates.
If the employee works extra hours during weekdays ,then they can en-cash 1x time their Normal Hourly Rates

In order to support the Weekend/Bank Holidays Extra Hours worked & Lieu days taken, lets create further Elements.
Element Name: XX Weekend Holidays Lieu Stored
Element Name: XX Pay from Weekend Holidays Lieu Stored

In order to track the Weekend/Holidays activities, lets create a Balance "Weekend Holidays Lieu Balance"
XX Weekend Holidays Lieu Stored : Add
XX Pay from Weekend Holidays Lieu Stored : Subtract

Why the need of Fast Formula?
Lets assume, if an Employee has "Weekday Lieu balance" of 2.5Hours.
Also, Lets assume that Employee has "Weekend Holidays Lieu Balance" worth 15Hours.

Business policy is that "Lieu off" can only be taken from "Weekday Lieu balance"
Effectively the Business policy states that "Lieu off" can NOT BE taken from "Weekend Holidays Lieu Balance"
This would mean that Work done during the Weekends can be en-cashed and never be taken off a Lieu.

If the employee takes a Lieu day off for 7.5Hours driving "Weekday Lieu balance" to negative, then entire balance in
"Weekend Holidays Lieu Balance" must be transferred to "Weekday Lieu balance" @ 1 times.

Before taking 7.5Hours in Lieu Off
After taking 7.5Hours in Lieu Off
"Weekday Lieu balance" = 2.5Hours
"Weekend Holidays Lieu Balance" = 15Hrs
"Weekday Lieu balance" = 10Hours
"Weekend Holidays Lieu Balance" = 0Hrs

So, here an employee faces 0.5x penalty if they take day off driving the balance negative.

Keep in mind, this is a pseudo example,
nowhere in world[I think] will a company Penalise an employee to loose their "Weekend Balance" in totality at the same rate as that of "Weekday Balance"

For adjusting such Balances automatically, we need to Write Fast Formula.

How did I reach a figure of 10Hrs Balance?
2.5[existing weekday balance] + 1*15[existing weekend balance] - 7.5[day off taken in Lieu]
=2.5 + 15 - 7.5

How do we do this? Explain the concept?
As you would notice, we are transferring from the "Weekend Balance" into "Weekday balance".
For doing so, we will create a new Element called "XX Lieu Transfer Element".
When Oracle Payroll Engine Runs, it will check if the Lieu Off is being taken in a manner that drives Weekday Balance to negative.
If Weekday Balance is driven Negative THEN ....."Value in Weekend Balance" will be assigned to "XX Lieu Transfer Element".

Fine, we will assign 15 (15*1) to Element "XX Lieu Transfer Element". But how will that increase the "Weekday Balance"?
Also how will that decrease the "Weekend Balance" to zero?
"Weekend Holidays Lieu Hours Balance" with dimension_ASG_ITD will now use three Elements
XX Weekend Holidays Lieu Stored : Add
XX Pay from Weekend Holidays Lieu Stored : Subtract
XX Lieu Transfer Element : Subtract

"Weekday Lieu balance" with dimension_ASG_ITD will now use Four Elements
XX Weekday Lieu Stored : Add
XX Day Off In Lieu : Subtract
XX Pay from Weekday Lieu Stored : Subtract
XX Lieu Transfer Element : Add

But how will Oracle Payroll automatically know that "Weekday Lieu Balance" is now Negative?
Also, how will Oracle Payroll Engine assign "Weekend Balance value" to element "XX Lieu Transfer Element"?
This is where Fast Formulas come into the play.
We will write a Fast Formula on Element "XX Lieu Transfer Element"


Following steps will happen internally inside Oracle's Payroll Engine
1. Payroll engine will try to calculate value for Element "XX Lieu Transfer Element"
2. Oracle Payroll engine will find that oops, this element has a Formula against it.
Hence Payroll will execute that formula, and we will assign the returned value from Formula to element "XX Lieu Transfer Element"'s input value.
This will happen due to the manner in which we will link the Formula to this Transfer Element.
3. Because this element feeds into both the Balances[Weekdays:add & Weekend:Subtract], such formula will automatically drive Weekend Balance to 0.

Can I see the above explanation step by step with screenshots?

Ensure that "Weekend Holidays Lieu balance" has been defined as below

Also note that currently Only two Elements feed into this Balance. As we are yet to define our transfer Element.

Ensure that Weekday Balance is currently 2.5Hours, and also Weekend Balance is 15hrs
This can be checked from Assignment Process Results screen. Or from QuickPay screen if we ran
Payroll for a single individual using Quickpay.

Now lets create the transfer Element, its Element Link and also Amend balances to include this new element.

Transfer Element Will have the following Attributes:-
1. Pay Value of Type Number
2. Type Information and also Recurring[as we want this Element to get attached each Period automatically]
3. IMPORTANT: Its priority will be 9000, and not default 500. This is so, because we want this Element to be processed after other Elements have been processed.
Hence, when Payroll Engine reaches to process this "Transfer Element", by that time Weekday Balance already would have been driven Negative[if applicable].
4. Also note that I haven't made its Input Value Mandatory

Click on the Button "Balance Feeds" and assign the Feed Values, as in screenshot below.
This new transfer element will Add to Weekday Balance, and will subtract from Weekend Balance/

Define the Element Link for "XX Lieu Transfer Element"
No need of a screenshot here, as we have well learnt this in previous training lesson.

We will define a formula named XX_XFER_LIEU
Type : Oracle Payroll.
Click on Show Items, and Query on WEEK%.
Inside Formula, I will have to check whether Weekday Balance is Less than 0.
Hence I would need a mechanism to reference the Current Balance inside a Fast Formula.
You can see the names that Oracle Payroll assigns to Balances by Clicking on Show Items

Below, I can see the two names that will act as variables inside our Fast Formula.

Now, to define the formula, lets click on Edit Button in the Formula screen.
A window similar to below will pop-up where you can define the logic of your Fast Formula.
For explanation of syntax etc, refer to Fast Formula white paper in Metalink.
As Seen below, note the following:-
1. We are referencing WEEKEND and Weekday balances as variables.
2. This formula returns a debug variable named xdebug.
3. This formula returns Weekend/Hols balance in variable v_xfer if Weekday Balance gets negative.
4. v_xfer will return 0 if Weekday Balance never got negative.

Now, lets go to Formula result window and here we will assign the values returned from the Formula to "XX Lieu Transfer Element"
Enter element name "XX Lieu Transfer Element" and click on Find.
In Processing Rules, select Standard and in Formula field select our Formula XX_XFER_LIEU

NOTE FROM ABOVE SCREENSHOT: We are assigning v_xfer to our Element "XX Lieu Transfer"
XDEBUG is just for debugging.

Now do the Element entry that will cause our Weekday Balance to go negative.
Lets make this person take 7.5Hrs off in Lieu, even though he has just 2.5hrs remaining in "Weekday Balance"
This is done by assigning 7.5Hrs to "XX Day Off In Lieu"

Now, lets run the Payroll using Quickpay for this specific person.
Navigate to Assignment record, and select the Option QuickPay, by clicking on button labeled Other
Run the Payroll for this person(I ran payroll for Mr Anil Passi for Month of March 2007)
Once the payroll quickpay is run, we can click on View Results followed by Quickpay Run Messages to view the debug messages.

Please find the debug message, indicating that 15Hrs were moved into "XX Lieu Transfer Element"

You can see that Weekend Balance has now become 0

You can also see that Weekday Balance has now become 10, as desired

This completes a step by step tutorial for Fast Formulas in Oracle Payroll.
Comments (11)add
written by Sudhir , January 24, 2007
Hi Anil,

Could you tell me how to call fast formula from a pl/sql block ?

written by Anil Passi , January 27, 2007
Hi Sudhir,

I will try to write up an article with screenshots to explain this.

basically , you need to register your pl/sql with Oracle payroll
written by Anil Passi , February 04, 2007
Hi Sudhir,

I have now written a dedicated article to answer your question.

Hope this helps,
Anil Passi
written by pratap , April 21, 2007
hey Anil,
Is there any way to check when my fast formula
is being called
written by Anil Passi , April 21, 2007
Hi Pratap,

In this example, I am populating a variable x_debug. You can create a debug variable and initialise this within fast formulae.

If the initialised value gets assigned, then it means your formula has been executed

written by Bibhuti , May 03, 2007
Hello Anil,
your site is most valuable thing for me.
but i am unable to get ur screen shots.
pls help me to get it.

written by Kuha , May 31, 2007
Hello Anil,

Your documents are useful. Have you done any updates on Fast Formulas?
written by mohan kundi , November 20, 2007
hi anil,
your document is so nice.can u pls send required documents for payroll to my mail id.

thank's & regards
mohan kundi
written by Suresh sane , December 04, 2007
this is extreemly super grate for ur efforts anil very nice to see this type of site
Fast Formulas
written by setty , January 30, 2008
Hi Anil
This site of yours is amazing. Pretty Useful for start up executives like us.
The snap shots you have given in this page are some how not to be shown. Can you Please
look into that and rectify.
Without the snap shots its kindda tough to follow.
I have created a fastformula, and the same is not appearing in the drop down list of the Calculation Rule when I am creating the Element ie Earning.
1. First I have created the Fast formulat
2. I am trying to creat the earning.
Is it the sequence or am I missing the path.
There has to be some more things I gotta be doing before creating the earning.
Can you Please list the steps to creat the fast formula, and linking it to the respective Earing.
If you were snap shots are available, it would have made my life easy.
Anil would appreciate your help with this ASAP.
written by setty , January 31, 2008
Hi Anil
Can you please see that these snap shots are to be seen by all of us.
We are not able to look at them, to follow the steps in associating the formula is getting tough.
Can you please help me out.
You must be logged in to a comment. Please register if you do not have an account yet.