You are on page 1of 10

Calculating Seniority Dates

Using Fast Formula

Oracle Fusion Human Capital Management

Oct 18, 2021 | Version 1.03


Copyright © 2021, Oracle and/or its affiliates
Public
PURPOSE STATEMENT
This document provides instructions on how to create fast formula and lists the parameters for the Employment
Seniority Date Adjustment and Employment Seniority Hours to Days Conversion fast formula types.

DISCLAIMER
This document in any form, software or printed matter, contains proprietary information that is the exclusive property
of Oracle. Your access to and use of this confidential material is subject to the terms and conditions of your Oracle
software license and service agreement, which has been executed and with which you agree to comply. This document
and information contained herein may not be disclosed, copied, reproduced or distributed to anyone outside Oracle
without prior written consent of Oracle. This document is not part of your license agreement nor can it be incorporated
into any contractual agreement with Oracle or its subsidiaries or affiliates.
This document is for informational purposes only and is intended solely to assist you in planning for the implementation
and upgrade of the product features described. It is not a commitment to deliver any material, code, or functionality, and
should not be relied upon in making purchasing decisions. The development, release, and timing of any features or
functionality described in this document remains at the sole discretion of Oracle.
Due to the nature of the product architecture, it may not be possible to safely include all features described in this
document without risking significant destabilization of the code.

DISCLAIMERS FOR PRE-RELEASE, PRE-GA PRODUCTS


The revenue recognition disclaimer on this page is required for any document that addresses future functionality or
for products that are not yet generally available (GA). If you are unsure whether your statement of direction needs the
disclaimer, read the revenue recognition policy. If you have further questions about your content and the disclaimer
requirements, e-mail REVREC_US@oracle.com.
The testing disclaimer in the copyright section on the last page (highlighted in yellow) is provided by the FCC for
hardware products. It must appear in the copyright section for all pre-release, pre-GA hardware products. Be sure to
remove the yellow highlighting before publishing. When the product becomes GA, update your collateral by removing
the disclaimer from the copyright section. If your product is already GA or if you are writing about a software product,
delete the disclaimer from the copyright section.
Important: If your product is not GA, then you cannot include any regulatory compliance information in the statement
of direction. Regulatory compliance information may be included for GA products only if you have completed all
required safety and emissions testing, and you have received the certificates issued by the testing organization.

2 Calculating Seniority Dates Using Fast Formula | Version 1.03


Copyright © 2021, Oracle and/or its affiliates | Public
TABLE OF CONTENTS
Purpose Statement 2
Disclaimer 2
Disclaimers For Pre-Release, Pre-GA Products 2
Introduction 4
Create Fast Formula 5
Context for Employment Seniority Date Adjustment 7
Sample Fast Formula Definition for Employment Seniority Date
Adjustment 8
Sample Fast Formula Definition for Employment Seniority Hours to Days
Conversion 9

3 Calculating Seniority Dates Using Fast Formula | Version 1.03


Copyright © 2021, Oracle and/or its affiliates | Public
INTRODUCTION
Fast formulas are generic expressions of calculations or comparisons that you want to repeat with different input
variables. You can use fast formula to calculate the seniority dates of a worker. This document describes the procedure
to create fast formula and lists the parameters for the Employment Seniority Date Adjustment and Employment
Seniority Hours to Days Conversion fast formula types.
This table shows the two fast formulas that we support in version 3 (V3) seniority dates.

FAST FORMULA TYPE INPUT PARAMETERS RETURN VARIABLES

Employment Seniority Date EFFECTIVE_START_DATE (DATE), EFF_DATE (DATE),


Adjustment SENIORITY_ADJUST_COMMENT
EFFECTIVE_END_DATE (DATE),
(TEXT),
SENIORITY_DATE_CODE (TEXT), SENIORITY_ADJUST_IN_DAYS
(NUMBER),
SENIORITY_BASIS (TEXT),
SENIORITY_ADJUST_IN_HOURS
CUMULATIVE_FLAG (TEXT), (NUMBER)

BASE_SENIORITY_DATE (DATE),
PREVIOUS_SENIORITY_EXIT_DATE
(DATE),
SENIORITY_LEVEL_OBJECT_ID
(NUMBER),
SENIORITY_TRIGGERING_FIELD_CODE
(TEXT),
ACTION_CODE (TEXT),
CHANGED_VALUE_NEW (TEXT),
CHANGED_VALUE_OLD (TEXT),
SENIORITY_LEVEL_CODE (TEXT),
TOTAL_SENIORITY_HOURS
(NUMBER),
PREVIOUS_TOTAL_SENIORITY_HOURS
(NUMBER),
SENIORITY_DATE (DATE),
LEGAL_EMPLOYER_ID (NUMBER),
LEGAL_EMPLOYER_NAME (TEXT),
ENTERPRISE_ID (NUMBER),
ENTERPRISE_NAME (TEXT),
BARGAINING_UNIT_CODE (TEXT),
BARGAINING_UNIT_NAME (TEXT),
GRADE_ID (NUMBER),
GRADE_NAME (TEXT),
GRADE_STEP_ID (NUMBER),
GRADE_STEP_NAME (TEXT),
JOB_ID (NUMBER),
JOB_NAME (TEXT),
POSITION_ID (NUMBER),
POSITION_NAME (TEXT),

4 Calculating Seniority Dates Using Fast Formula | Version 1.03


Copyright © 2021, Oracle and/or its affiliates | Public
FAST FORMULA TYPE INPUT PARAMETERS RETURN VARIABLES

UNION_ID (NUMBER),
UNION_NAME (TEXT),
LOCATION_ID (NUMBER),
LOCATION_NAME (TEXT),
DEPARTMENT_ID (NUMBER),
DEPARTMENT_NAME (TEXT),
COLLECTIVE_AGREEMENT_ID
(NUMBER),
COLLECTIVE_AGREEMENT_NAME
(TEXT),
PAST_PERIOD_IN_DAYS (NUMBER),
EFFECTIVE_SEQUENCE (NUMBER),
EFFECTIVE_LATEST_CHANGE (TEXT)

Employment Seniority Hours to Days EFFECTIVE_START_DATE (DATE), RETURN_HOURS (NUMBER),


Conversion
EFFECTIVE_END_DATE (DATE), RETURN_YEARS (NUMBER),
DIRECTION (TEXT), RETURN_MONTHS (NUMBER),
HOURS (NUMBER), RETURN_DAYS (NUMBER)
YEARS (NUMBER),
MONTHS (NUMBER),
DAYS (NUMBER)

CREATE FAST FORMULA


1. Click Navigator > Setup and Maintenance.
2. On the Tasks panel tab, click Search.
3. In the search box, enter Manage Fast Formulas, and click the Search icon.
4. Click the Manage Fast Formulas task name.
5. In the Search Results area, click the Create icon.

6. In the Create Fast Formula dialog box, do the following.


 Enter the formula name.
 Select the Employment Seniority Date Adjustment type.
 Select the effective start date.

5 Calculating Seniority Dates Using Fast Formula | Version 1.03


Copyright © 2021, Oracle and/or its affiliates | Public
 Click Continue.

7. Enter the fast formula logic in the Formula Text box.


Note: If you want to use database items (DBIs), search the DBI name on the Database Items tab, select the row
from the search results, and then click Add to Formula.

8. Click Submit, and then click Compile to check whether the fast formula is valid.

6 Calculating Seniority Dates Using Fast Formula | Version 1.03


Copyright © 2021, Oracle and/or its affiliates | Public
9. Click OK, and then click Done.
10. If the compile process is successful, a check icon is displayed in the search results. If the compile process fails,
check the error message for details.

CONTEXT FOR EMPLOYMENT SENIORITY DATE ADJUSTMENT


Use the following query to list the context types for the Employment Seniority Date Adjustment formula type:

SELECT C.BASE_CONTEXT_NAME

FROM FF_FORMULA_TYPES_B T

, FF_FORMULA_TYPES_TL TTL

, FF_FTYPE_CONTEXT_USAGES U

, FF_CONTEXTS_B C

WHERE T.FORMULA_TYPE_ID = U.FORMULA_TYPE_ID

AND TTL.FORMULA_TYPE_ID = T.FORMULA_TYPE_ID

AND T.BASE_FORMULA_TYPE_NAME = 'Employment Seniority Date Adjustment'

7 Calculating Seniority Dates Using Fast Formula | Version 1.03


Copyright © 2021, Oracle and/or its affiliates | Public
AND TTL.LANGUAGE = USERENV('LANG')

AND C.CONTEXT_ID = U.CONTEXT_ID

SAMPLE FAST FORMULA DEFINITION FOR EMPLOYMENT SENIORITY DATE


ADJUSTMENT
You must use the following parameters for the Employment Seniority Date Adjustment formula type.
/****************************************************************************
*
* Formula Name:
*
* Description: This formula using the following context:
* EFFECTIVE_DATE, PERSON_ID, HR_RELATIONSHIP_ID, HR_TERM_ID, HR_ASSIGNMENT_ID
*
****************************************************************************/
default for SENIORITY_ADJUST_COMMENT is 'no adjustment'
default for SENIORITY_ADJUST_IN_DAYS is 0
default for SENIORITY_ADJUST_IN_HOURS is 0
default for CUMULATIVE_FLAG is 'N'
default for SENIORITY_BASIS is 'ORA_PER_SNDT_DAYS'
default for PREVIOUS_SENIORITY_EXIT_DATE is '1900/01/01 00:00:00' (DATE)
default for BASE_SENIORITY_DATE is '1900/01/01 00:00:00' (DATE)

INPUTS ARE
EFFECTIVE_START_DATE (DATE),
EFFECTIVE_END_DATE (DATE),
SENIORITY_DATE_CODE (TEXT),
SENIORITY_BASIS (TEXT),
CUMULATIVE_FLAG (TEXT),
BASE_SENIORITY_DATE (DATE),
PREVIOUS_SENIORITY_EXIT_DATE (DATE),
SENIORITY_LEVEL_OBJECT_ID (NUMBER),
SENIORITY_TRIGGERING_FIELD_CODE (TEXT),
ACTION_CODE (TEXT),
CHANGED_VALUE_NEW (TEXT),
CHANGED_VALUE_OLD (TEXT),
SENIORITY_LEVEL_CODE (TEXT),
TOTAL_SENIORITY_HOURS (NUMBER),
PREVIOUS_TOTAL_SENIORITY_HOURS (NUMBER),
SENIORITY_DATE (DATE),
LEGALEGAL_EMPLOYER_ID (NUMBER),
LEGAL_EMPLOYER_NAME (TEXT),
ENTERPRISE_ID (NUMBER),
ENTERPRISE_NAME (TEXT),
BARGAINING_UNIT_CODE (TEXT),
BARGAINING_UNIT_NAME (TEXT),
GRADE_ID (NUMBER),
GRADE_NAME (TEXT),
GRADE_STEP_ID (NUMBER),
GRADE_STEP_NAME (TEXT),
JOB_ID (NUMBER),
JOB_NAME (TEXT),
POSITION_ID (NUMBER),
POSITION_NAME (TEXT),
UNION_ID (NUMBER),
UNION_NAME (TEXT),
LOCATION_ID (NUMBER),
LOCATION_NAME (TEXT),
DEPARTMENT_ID (NUMBER),
DEPARTMENT_NAME (TEXT),
COLLECTIVE_AGREEMENT_ID (NUMBER),
COLLECTIVE_AGREEMENT_NAME (TEXT)

/* check if the date is passed */


EFF_DATE = EFFECTIVE_START_DATE
if PREVIOUS_SENIORITY_EXIT_DATE WAS DEFAULTED or BASE_SENIORITY_DATE WAS DEFAULTED then (
return EFF_DATE, SENIORITY_ADJUST_COMMENT, SENIORITY_ADJUST_IN_DAYS, SENIORITY_ADJUST_IN_HOURS
)

RETURN_THRESHOLD = 6 /* month */
retain_expired = 'N'
compare_date = ADD_MONTHS(PREVIOUS_SENIORITY_EXIT_DATE, RETURN_THRESHOLD)
if EFFECTIVE_START_DATE > compare_date then (
retain_expired = 'Y'
)

8 Calculating Seniority Dates Using Fast Formula | Version 1.03


Copyright © 2021, Oracle and/or its affiliates | Public
if SENIORITY_BASIS = 'ORA_PER_SNDT_DAYS' then (
if CUMULATIVE_FLAG = 'Y' then (
if retain_expired = 'Y' then (
SENIORITY_ADJUST_IN_DAYS = DAYS_BETWEEN(BASE_SENIORITY_DATE, PREVIOUS_SENIORITY_EXIT_DATE)
SENIORITY_ADJUST_IN_DAYS = SENIORITY_ADJUST_IN_DAYS + 1
SENIORITY_ADJUST_COMMENT = 'Previous Seniority (' + to_char(SENIORITY_ADJUST_IN_DAYS) + ' days) is
lost as the Bridging Period exceeds 6 months.'
return EFF_DATE, SENIORITY_ADJUST_COMMENT, SENIORITY_ADJUST_IN_DAYS, SENIORITY_ADJUST_IN_HOURS
)
) else (
if retain_expired = 'N' then (
SENIORITY_ADJUST_IN_DAYS = DAYS_BETWEEN(PREVIOUS_SENIORITY_EXIT_DATE, BASE_SENIORITY_DATE)
SENIORITY_ADJUST_IN_DAYS = SENIORITY_ADJUST_IN_DAYS + 1
SENIORITY_ADJUST_COMMENT = 'Previous Seniority (' + to_char(SENIORITY_ADJUST_IN_DAYS) + ' days) is
retained as the Bridging Period does not exceed 6 months.'
return EFF_DATE, SENIORITY_ADJUST_COMMENT, SENIORITY_ADJUST_IN_DAYS, SENIORITY_ADJUST_IN_HOURS
)
)
)
if SENIORITY_BASIS = 'ORA_PER_SNDT_HOURS' then (
comment = 'TODO'
)
return EFF_DATE, SENIORITY_ADJUST_COMMENT, SENIORITY_ADJUST_IN_DAYS, SENIORITY_ADJUST_IN_HOURS

SAMPLE FAST FORMULA DEFINITION FOR EMPLOYMENT SENIORITY HOURS


TO DAYS CONVERSION
You must use the following parameters for the Employment Seniority Hours to Days Conversion formula type.
/* default logic to 2 way conversion for Hours to YearMonthDay (YMD) and YMD to Hours
*/

default for DIRECTION is 'H2D'


INPUTS ARE
EFFECTIVE_START_DATE (DATE),
EFFECTIVE_END_DATE (DATE),
DIRECTION (TEXT),
HOURS (NUMBER),
YEARS (NUMBER),
MONTHS (NUMBER),
DAYS (NUMBER)

if DIRECTION = 'D2H' then


(
RETURN_HOURS = YEARS*2080 + MONTHS*173 + DAYS*8
)
else
(
RETURN_YEARS = 0
RETURN_MONTHS = 0
RETURN_DAYS = 0
TMP_HOURS = HOURS
if TMP_HOURS >= 2080 then
(
RETURN_YEARS = FLOOR(TMP_HOURS/2080)
TMP_HOURS = MOD(TMP_HOURS, 2080)
)
if TMP_HOURS >= 173 then
(
RETURN_MONTHS = FLOOR(TMP_HOURS/173)
TMP_HOURS = MOD(TMP_HOURS, 173)
)
if TMP_HOURS >= 8 then
(
RETURN_DAYS = FLOOR(TMP_HOURS/8)
TMP_HOURS = MOD(TMP_HOURS, 8)
)
if TMP_HOURS > 0 then
(
RETURN_DAYS = RETURN_DAYS + 1
)
)
return
RETURN_HOURS,
RETURN_YEARS,
RETURN_MONTHS,
RETURN_DAYS

9 Calculating Seniority Dates Using Fast Formula | Version 1.03


Copyright © 2021, Oracle and/or its affiliates | Public
CONNECT WITH US
Call +1.800.ORACLE1 or visit oracle.com.
Outside North America, find your local office at oracle.com/contact.

blogs.oracle.com facebook.com/oracle twitter.com/oracle

Copyright © 2021, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the contents hereof are subject to change without
notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties
and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are formed
either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without
our prior written permission.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of
SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered
trademark of The Open Group. 0120

Document: Calculating Seniority Dates Using Fast Formula


18 October 2021
Author: Girish Singh

10 Calculating Seniority Dates Using Fast Formula | Version 1.03


Copyright © 2021, Oracle and/or its affiliates | Public

You might also like