SAP Knowledge Base Article - Public

2345108 - How to - Creating a Business Rule to Calculate Age

Symptom

You wish to calculate the age of an employee and maintain this information in the biographical information Portlet

Outcome Bio Info.PNG

Environment

Employee Central - Biographical Information

Resolution

There are two different ways in which the age of your employees can be displayed.

They are YY/MM/DD or the value in years (Rounded Down).

  • In order to use the YY/MM/DD format you must ensure the age field is a custom string field.
  • In order to use the value in years (rounded down) you must ensure the age field is a custom double (Numeric) field.

 

To Create the rule:

Go to Admin Centre> Configure Business Rules

Create a Basic Rule with Base component Biographical information, and use either one of the SET conditions in the below example (not both) -:

  • For YY/MM/DD create a rule using the "Convert to YY/MM/DD" function
  • For the age value (rounded down) use the "Difference in Years Round Down" function

AGE 2 version.png

Set the Rule as onView on the Biographical Information element - either via xml or the Manage Business Configuration tool.

Manage Bsuienss Config.jpg

 

NOTE: onView, Calculated fields are transient fields and so no data is saved to the system. The Values will dynamically calculate each time that you visit the users Biographical Information. You will not be able to report on the value, so long as the rule is set to trigger onView.

See Also

2364155 - Age field not displaying values in Advanced Reporting

2577292 - How to calculate age on a specific event date in Online Report Designer?

Keywords

Business Rules, Calculating Age, Calculate Age, Age Field, age , KBA , LOD-SF-EC-RUL , Business Rules & Event Derivation , LOD-SF-EC , Employee Central , How To

Product

SAP SuccessFactors HCM Suite all versions