You are on page 1of 12

4/24/2022

Stories in People Analytics


Generated on: 2022-04-24 19:59:13 GMT+0000

SAP SuccessFactors People Analytics | 2H 2020

PUBLIC

Original content:
https://help.sap.com/docs/SAP_SUCCESSFACTORS_PEOPLE_ANALYTICS/dad69084edb947e98ebede671ecd26f0?locale=en-
US&state=PRODUCTION&version=2011

Warning

This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product
documentation. The information included in custom documentation may not re ect the arrangement of topics in the SAP Help
Portal, and may be missing important aspects and/or correlations to other topics. For this reason, it is not for productive use.

For more information, please visit the https://help.sap.com/docs/disclaimer.

This is custom documentation. For more information, please visit the SAP Help Portal 1
4/24/2022

Formula Functions in Calculated Columns for Stories in People


Analytics
You can use Calculated Columns in your report to derive data by applying functional, conditional, and arithmetical operations on
data stored in other columns.

Functions

Function Name Description Code Syntax with Example

ABS() Returns the absolute


 Code Syntax
value of a number.
Abs(num)

num: A number

 Example

Abs(-11)

returns 11

ADDDAYTODATE() Returns the date


 Code Syntax
produced by adding a
speci ed number of AddDayToDate(date,periods)
days (periods) to a
speci ed date (date).
date: A Date or Datetime object

periods: A number of days

 Example

AddDayToDate(#2015-01-20#, 2)

returns 2015-01-22

ADDMONTHTODATE() Returns a date that is


 Code Syntax
produced by adding a
speci ed number of AddMonthToDate(#date#,periods)
months to a speci ed
date.
#date#: Original date

periods: Number of periods to add

 Example

AddMonthToDate(#2012-01-01#,1)

returns 2012-02-01

This is custom documentation. For more information, please visit the SAP Help Portal 2
4/24/2022

Function Name Description Code Syntax with Example

CONCAT() Concatenates two


 Code Syntax
strings into a single
string. Concat(str1, str2)

str1: First string

str2: Second string

The operator + can also concatenate strings.

 Example

Concatenate("Mr", "Brown")

returns "MrBrown"

CONTAIN() Returns occurrences of


 Code Syntax
a string within another
string. The search is Contain(whereStr, whatStr)
not case-sensitive.

whereStr: String in which a search is conducted

whatStr: Substring that is the object of the search

 Example

Contain("Cats are grey", "aRe")

returns true

DAY() Returns the day of the


 Code Syntax
month as a number
from 1 to 31. Day(#date#)

#date#: A date

 Example

Day(#2012-03-23#)

returns 23

This is custom documentation. For more information, please visit the SAP Help Portal 3
4/24/2022

Function Name Description Code Syntax with Example

DAYS_BETWEEN() Returns the number of


 Code Syntax
days between two
dates. Days_Between(#date1#, #date2#)

#date1#, #date2#: Date values

 Example

Days_Between(#2019-03-06#, #2019-05-06#)

returns 61

DOUBLE() Converts argument to a


 Code Syntax
high precision oating
point number. Double(arg)

int: An integer

 Example

Double(14)

returns 14.0

FLOAT() Converts argument to a


 Code Syntax
oating point number.
Float(arg)

int: An integer

 Example

Double(14)

returns 14.0

This is custom documentation. For more information, please visit the SAP Help Portal 4
4/24/2022

Function Name Description Code Syntax with Example

IF() Chooses between two


 Code Syntax
alternatives, based on
whether a Boolean If(<cond>, <alt1>, <alt2>)
condition is true or
false. The rst cond: Boolean condition to test
alternative
corresponds to true alt1: Alternative 1
and second value
alt2: Alternative 2
corresponds to false.
The second alternative
is optional and
evaluates to null  Example
when missing.
If(#2018-03-10# >= CURRENTDATE(), "It's On", "It's Gone")

returns It's Gone

ISNULL() Returns a Boolean


 Code Syntax
value that indicates
whether the supplied IsNull(obj)
eld contains a null
value. If a eld
contains a null value, obj: User object (column)
the function returns
true. Otherwise it
returns false.

LEFT() Returns the left part of


 Code Syntax
a speci ed string, with
the speci ed number Left(str, num)
of characters.

str: Input string

num: Number of characters you select from the input string, left to right.

 Example

Left("Mathematics", 4)

returns Math

LENGTH() Returns the length of a


 Code Syntax
string.
Length(str)

str: Input string

 Example

Length("How long")

returns 8

This is custom documentation. For more information, please visit the SAP Help Portal 5
4/24/2022

Function Name Description Code Syntax with Example

LIKE() Determines whether a


 Code Syntax
character string
matches a speci ed <matchExpr> like <pattern>
pattern. The search is
not case-sensitive.
matchExpr: The string expression to search

pattern: The pattern string constant to search for

The pattern can include regular characters and the following special characters:

"_" matches a single character

"%" matches zero to many characters

Before you can use a special character as a regular character, you must escape
it, using a backslash ("\").

 Note
"[", "^", "-", and "]" are reserved for future use.

 Example

"Hiking is fun" like "H% is _un"

returns true

LOCATE() Returns the position of


 Code Syntax
the rst occurrence of
a sub-string in a string. Locate(substring, string, start index)

substring: A part of the string that you want to locate

string: A string that contains the sub-string

start index: A positive number lesser than the length of the string.

 Example

Locate("on","concoction",2)

LOG() Returns the natural


 Code Syntax
logarithm of a
speci ed number. Log(num)

num: A number

 Example

Log(100)

returns 4.605

This is custom documentation. For more information, please visit the SAP Help Portal 6
4/24/2022

Function Name Description Code Syntax with Example

LOG10() Returns the base 10


 Code Syntax
logarithm of a
speci ed number. Log10(num)

num: A number

 Example

Log10(100)

returns 2

LOWERCASE() Returns a copy of a


 Code Syntax
string, with all
characters converted LowerCase(str)
to lowercase.

str: Input string

 Example

LowerCase("GOOD JOB")

returns "good job"

MONTH() Returns the month of


 Code Syntax
the year as a number
from 1 to 12. Month(#date#)

#date#: A date

 Example

Month(#2012-03-23#)

returns 3

NOT() Use to negate a


 Code Syntax
Boolean input.
not<bool>

bool: A Boolean

 Example

not false

returns true

This is custom documentation. For more information, please visit the SAP Help Portal 7
4/24/2022

Function Name Description Code Syntax with Example

POWER() Raises a number to a


 Code Syntax
power.
Power(num, exponent)

num: A number

exponent: The exponent

The operator ^ (caret) can be used instead of this function.

 Example

Power(2,3)

returns 8

QUARTER() Returns a number that


 Code Syntax
represents the quarter
of a speci ed date. Quarter(#date#)

#date#: A date

 Example

Quarter(#2012-03-23#)

returns 1

REPLACE() Returns a string, with


 Code Syntax
all occurrences of a
speci ed string Replace(str, target, replacement)
replaced with another
speci ed string.
str: Input string

target: String to be replaced

replacement: String value to insert

 Example

Replace("hyperthermia", "ert", "ot")

returns "hypothermia"

This is custom documentation. For more information, please visit the SAP Help Portal 8
4/24/2022

Function Name Description Code Syntax with Example

RIGHT() Returns the right part


 Code Syntax
of a speci ed string,
with the speci ed Right(str, num)
number of characters.

str: Input string

num: Number of characters you select from the input string, counting
from right to left.

 Example

Left("Closure", 4)

returns sure

ROUND() Returns a numeric


 Code Syntax
value, rounded to a
speci ed number of Round(num, digits)
decimal places.

num: A number

digits: The number of decimal places to round off to.

 Example

Round(14.81, 1)

returns 14.8

SUBSTRING() Returns a substring of


 Code Syntax
a string.
SubString(str, start)

str: String from which a substring is computed

start: Start position in the input substring

 Example
For example:

SubString("Wong", 3)

returns "ng"

This is custom documentation. For more information, please visit the SAP Help Portal 9
4/24/2022

Function Name Description Code Syntax with Example

TODATE() Converts an input


 Code Syntax
string to a date in a
speci ed format, when ToDate(string, format)
the dates in a column
of an original data
source are in string string: Input string to convert
format.
format: Date format

The date format is a combination of the following reserved tokens, separated by


delimiters:

d or dd: Day of month (1-31)

M or MM: Month of year (1-12)

y or yy: Abbreviated year without century (00-99)

yyyy: Year with century (1956, 2012, 2014, and so on)

All other characters are considered delimiters.

 Example

ToDate(Obj, 'yyyy/dd/MM')

converts a string in the format yyyy/dd/MM to a date

TOINTEGER() Returns an integer


 Code Syntax
representation of a
character string in the ToInteger(numberStr)
form of an integer
constant.
numberStr: A numberical value, which is entered as a string

 Example
For example:

ToInteger("123")

returns 123

TONUMBER() Converts any type of


 Code Syntax
parameter to a numeric
value. Numbers are ToNumber(param)
truncated to zero
decimal places.
param: Parameter to convert

This is custom documentation. For more information, please visit the SAP Help Portal 10
4/24/2022

Function Name Description Code Syntax with Example

TOTEXT() Converts a speci ed


 Code Syntax
number or a parameter
to a string. The number ToText(num, digits) or ToText(param)
is truncated to the
speci ed number of
decimal places. num: A number

digits: Number of decimal places to use. This parameter is optional,


and its default value is 0.

param: Parameter to convert

 Example

ToText(12.1451, 2)

returns 12.14

UPPERCASE() Returns a copy of a


 Code Syntax
string, with all
characters converted UpperCase(str)
to uppercase.

str: Input string

 Example

UpperCase("Little Boy")

returns "LITTLE BOY"

WEEK() Returns a number that


 Code Syntax
represents the week of
a speci ed date. Week(#date#)

#date#: A date

 Example

Week(#2012-03-23#)

returns 12

This is custom documentation. For more information, please visit the SAP Help Portal 11
4/24/2022

Function Name Description Code Syntax with Example

YEAR() Returns the year of a


 Code Syntax
speci ed date.
Year(#date#)

#date#: A date

 Example

Year(#2012-03-23#)

returns 2012

Conditions and Operators

Condition Name Description Code Syntax with Example

AND Returns the logical conjunction of its


 Code Syntax
Boolean inputs. This function returns
false: true and false. <left> and <right>

left: Left operand

right: Right operand

OR Returns the logical disjunction of its


 Code Syntax
Boolean inputs. This function returns true:
true or false. <left> or <right>

left: Left operand

right: Right operand

> (Greater than), < (Lesser than), >= Returns the comparison results between
 Example
(Greater than or equals), <= (Lesser than or two operands with compatible types.
equals), = (Equals), and != (Not equals) 1 = 1, returns true

1 = 2, returns false

1 > 1, returns false

2 > 1, returns true

+ (Add), - (Substract), * (Multiply), and / These are basic numeric calculations.


 Code Syntax
(Divide)
num1 + num2 ; num1 - num2 ;
etc.

num1, num2: Numbers

This is custom documentation. For more information, please visit the SAP Help Portal 12

You might also like