Pages

Recently Viewed

Showing posts with label Fusion - FastFormula. Show all posts
Showing posts with label Fusion - FastFormula. Show all posts

Sunday, January 8, 2023

How to use Fast Formula in HCM Extract

Requirement 
Can we use Fast Formula in HCM Extrat to derive any Database calculation ?


Solution 
Oralce provides rule type attribute in HCM extract.  We can use this type to use fast formula driven attribute. 


In order to access Fast formula in Extract attributes, use type = "Extract Rule" 






If using GET_VALUE_SET method to cal value set ( only TABLE type value set are supported). Please ensure you pass value to ID field as well.  






Tuesday, April 7, 2020

Context in Fast Formula

Fast Formula in Cloud can use context setting to derive values at different context.

For example if there is a requirement to display Current Salary and First Salary for given assignment. An Extract can be setup by creating 3 attributes with Assignment  user entity.

Attribute1 - CurrentSal - Type (Database Item Group)  - ASSIGNMENT SALARY
Attribute2  - DATE_FROM  Type (Database Item Group) - ASSIGNMENT START DATE

Attribute3 - FirstSal      - Type (Rule)












Fast Formula To derive Salary on different date.
/**************************************************************/
DEFAULT FOR CMP_ASSIGNMENT_SALARY_AMOUNT IS 0

INPUTS ARE DATA_ELEMENTS (TEXT_TEXT)

l_effective_date = TO_DATE(SUBSTR(TRANSLATE(DATA_ELEMENTS['DATE_FROM'],'01234567890:.-TZ', '01234567890:.- '), 1, 19), 'YYYY-MM-DD HH24:MI:SS')

CHANGE_CONTEXTS(EFFECTIVE_DATE= l_effective_date)

RULE_VALUE = TO_CHAR(CMP_ASSIGNMENT_SALARY_AMOUNT)

RULE_VALUE = TRIM(RULE_VALUE)

RETURN RULE_VALUE
/**************************************************************/

. Read the Extract Attribute - DATE FROM
. Set The Context for Effective Date
. Get the Database Item Value ( as on set date)
. Return this value 

Create Custom Fast Formula in HCM Cloud

1) Go to Setup and Maintenance >> Search Task Fast Formulas
2) Create a new fast formula
3) Give Name , Type and Effective Start Date


















4) Don't assign Legislative Data Group Name ( Otherwise you can't refer these Fast Formula)
5) Effective Start Date should be 01/01/0001

Use SELECT Query In Fast Formula

SQL can be used in fast formula with help of TABLE type value set

Steps:

1) Go to Setup and Maintenance >> Search Manage Value Sets for Global Human Resource task >> Create a new value Set
>> Validation Type = TABLE

Module                       -  Module Name  ( Extract etc)
From Clause               -  TABLE Name ( cmp_salary)
Value Column Name  -  ColumnName ( Salary_amount )
WHERE Clause          - Conditions

2) Use Parameter in WHERE Clause if required. ( Parameter will be passed from fast Formula only).
Example
Assignment_id = :{PARAMETER.ASSIGNMENT_ID}

ASSIGNMENT_ID is parameter Name, which need to be passed from Fast Formula.

3) Create Fast Formula and fetch value set value using following method  GET_VALUE_SET('ValueSetName','BindVariable')

ValueSetName - Mandatory - Pass ValueSet Name
BindVariable   - Optional  -  Value for Parameters

Syntex for Bind variable -
'|=PARAMNAME1='''''||Value1||'|PARAMNAME2=''''||Value2||''''


** This method might work only for payroll flow. I could not get return while using from Extract