Calling Functions

Designer Administrator
This manual is in pilot operation.

In expressions, you can call built-in functions. A function takes one or more arguments (some functions take no arguments) and returns a single value. You can then perform further calculations or conditional evaluation based on the returned value.
Available functions differ depending on the type of expression.

Function names start with @.
  @some_function (1)
1 Calls the function named some_function without arguments. Writing @some_function() has the same meaning.
Arguments are enclosed in (). If there are multiple arguments, separate them with ,.
  @other_function(1, "a") (1)
1 Calls the function named other_function with the arguments 1 and a.

Available functions are as follows.

Functions Available in All Dialects

Numeric Functions

Function Arguments
(If optional, enclose with [])
Description

@abs
(fusion_place >= 10.0)

1st argument

Numeric

Returns the absolute value of the numeric value.

If the argument is not numeric, returns it as is.

@max
(fusion_place >= 10.0)

Any number of arguments

Returns the maximum numeric value among the arguments.

If there are no arguments or there is no numeric argument, returns 0.

@min
(fusion_place >= 10.0)

Any number of arguments

Returns the minimum numeric value among the arguments.

If there are no arguments or there is no numeric argument, returns 0.

@round

1st argument

Numeric

2nd argument

Numeric: Number of digits

Rounds the fractional part of the numeric value and returns it. Rounding down is performed toward zero rather than toward negative infinity, and rounding up is performed toward positive infinity if the value is positive and toward negative infinity if the value is negative. For example, if you round -4.5 to the first decimal place, the result is -5, not -4.

Number of digits is specified as follows:

  1. Keep only the integer part (round at the first decimal place) ― number of digits is 0

  2. Keep up to the first decimal place (round at the second decimal place) ― number of digits is 1

  3. Keep up to the second decimal place (round at the third decimal place) ― number of digits is 2

  4. Keep 10s and above (round at the units place) ― number of digits is -1

  5. Keep 100s and above (round at the tens place) ― number of digits is -2

For the number of digits, you can specify an integer between -14 and 4.

@round_up

Same as @round

Rounds up the fractional part of the numeric value and returns it. Rounding up is performed toward positive infinity if the value is positive and toward negative infinity if the value is negative.
Number of digits is specified in the same way as for @round.

@round_down

Same as @round

Rounds down the fractional part of the numeric value and returns it. Rounding down is always performed toward zero regardless of the sign of the value.
Number of digits is specified in the same way as for @round.

@multiply_fraction

1st argument

Numeric: Multiplier

2nd argument

Numeric: Numerator

3rd argument

Numeric: Denominator

Calculates a * b / c without performing rounding in the middle of the calculation and without causing overflow. Finally, the value is rounded at the fifth decimal place to obtain the result up to the fourth decimal place.

The 1st to 3rd arguments correspond to a to c above in that order.

@power
(fusion_place >= 15.0)

1st argument

Numeric: Base a in “a to the power of b”

2nd argument

Numeric: Exponent b in “a to the power of b”
If the base is negative, the exponent must be an integer

3rd argument

Numeric: Scaling factor
Integer greater than or equal to 0. When omitted, treated as 0

Calculates the power of a numeric value, and if the 3rd argument is specified, multiplies the result by 10 to the power of n and returns it.

The power is calculated using double-precision floating-point arithmetic. Fractional parts are rounded at the fourth decimal place. Rounding is performed after applying the scaling factor.

(Numeric examples)

  @power(2, 3)8
  @power(2, 0.5)1.4142
  @power(2, 0.5, 0)1.4142
  @power(2, 0.5, 2)141.4214

String Functions

Function Arguments
(If optional, enclose with [])
Description

@is_numeric

1st argument

String

[2nd argument]

Boolean: Ignore maximum decimal places
(fusion_place >= 14.1)

Determines whether the string can be interpreted as a numeric value. If it can be interpreted, returns True, otherwise returns False. Decimal places are supported up to 4 digits. If more than 4 digits are used, the result is False.

The 1st argument is the target string for evaluation.

The 2nd argument is a Boolean value.
If True, evaluates whether the string can be converted to a numeric value ignoring the restriction on the number of decimal places.
If False, behaves the same as when the 2nd argument is not specified.

@numeric

1st argument

String

[2nd argument]

String: Rounding mode
(fusion_place >= 14.1)

[3rd argument]

Numeric: Scaling factor
(fusion_place >= 14.1)

1st form: @numeric(String)

Converts a string to a numeric value. Decimal places are supported up to 4 digits. If there are more than 4 decimal places, the import result becomes #VALUE!.

2nd form: @numeric(String, RoundingMode)

(fusion_place >= 14.1)
Converts a string to a numeric value. There is no limit on the number of decimal places.
Decimal places beyond the fourth digit are rounded according to the 2nd argument, the rounding mode⚠.

3rd form: @numeric(String, RoundingMode, ScalingFactor)

(fusion_place >= 14.1)
Converts a string to a numeric value. There is no limit on the number of decimal places.
Converts the string after adjusting its scale according to the 3rd argument ScalingFactor. Decimal places beyond the fourth digit of the converted numeric value are rounded according to the 2nd argument, the rounding mode⚠.

If you do not adjust the scale, specify 0. To convert to thousands, specify 3 (the numeric value represented by the input string is multiplied by one thousand at import).

⚠ The rounding mode (2nd argument) is as follows (case-insensitive):

  1. "DOWN": Rounds down toward zero

  2. "UP": Rounds up toward positive infinity if the value is positive and toward negative infinity if the value is negative

  3. "HALF_UP": Performs rounding. Rounding down is performed toward zero rather than toward negative infinity, and rounding up is performed toward positive infinity if the value is positive and toward negative infinity if the value is negative.

⚠ A string containing exponential notation can be converted to a numeric value. (fusion_place >= 14.2)

@left

1st argument

String

2nd argument

Numeric: Number of characters

Returns the leftmost n characters from the string.

If the specified number of characters is negative, returns a string of length (string length + number of characters) from the left side. For example, if the string length is 5 and the number of characters is -2, returns the leftmost 3 characters (leaving 2 characters on the right).

@right

Same as above

Returns the rightmost n characters from the string.

If the specified number of characters is negative, returns a string of length (string length + number of characters) from the right side. For example, if the string length is 5 and the number of characters is -2, returns the rightmost 3 characters (leaving 2 characters on the left).

@mid

1st argument

String

2nd argument

Numeric: Start position

3rd argument

Numeric: Number of characters

Returns a substring from the string. The start position is 1-based.

@trim
(fusion_place >= 10.0)

1st argument

String

Returns the string with leading and trailing spaces removed.

@len

1st argument

String

Returns the length of the string.

@text

1st argument

Numeric

2nd argument

Numeric: Format pattern

[3rd argument]

Numeric: Scaling factor

Returns a string that formats the numeric value according to the format pattern.

The format pattern uses the same notation as the patterns available in Display Methods of Amounts and Numbers in Forms.

The scaling factor specifies the power of 10. For example, 0 means no scaling, 1 means tens, and 3 means thousands (if omitted, it is treated as 0).

@repeat

1st argument

String

2nd argument

Numeric: Number of repetitions

Returns a string that repeats the string specified by the 1st argument as many times as specified by the 2nd argument. If the 2nd argument is zero or less, returns an empty string.

@find
(fusion_place >= 10.0)

1st argument

String: Search string

2nd argument

String: Target string

[3rd argument]

Numeric: Start position

Returns the position where the search string first appears in the target string. Case-sensitive.

If an empty string is specified as the search string, it is considered to match just after the start position, and the start position is returned.

The start position specifies where to begin searching (1 is the first character). If omitted, it is treated as 1.

The return value is the position counted from the first character regardless of the start position. If the target string is not found, the error value #VALUE! is returned.

@substitute

1st argument

String

2nd argument

String: Substring to be replaced

3rd argument

String: Replacement string

Replaces all occurrences of a specific substring in the string.

@split

1st argument

String

2nd argument

String: Delimiter string

3rd argument

Numeric: Index

Returns the Index-th substring when the string is split by the delimiter string. Index is 1-based.

@num_of_chars_of_type

1st argument

Numeric: Integer representing character types

2nd argument

String: Target string

Counts how many characters of the specified character type exist in the string and returns the count.

The 1st argument is an integer representing a character type. Specify one of the following or any sum of them:

1

Digits

2

Uppercase letters

4

Lowercase letters

8

Whitespace characters

If a sum is specified, returns the total number of characters that belong to any of the selected character types.

The 2nd argument specifies the string to be checked.

For example, to check that the cell specified by [PRO_CD] contains only alphanumeric characters, use the following:

  @num_of_chars_of_type(1+2+4, [PRO_CD].Text)=@len([PRO_CD].Text)

@num_of_listed_chars

1st argument

String: String that lists characters to search for

2nd argument

String: Target string

Counts how many occurrences of the specified characters exist in the string and returns the count.

The 1st argument is a string that lists the characters to be checked. Be aware that if the same character appears multiple times in the list, each occurrence is counted.

The 2nd argument specifies the string to be checked.

For example, to count the number of - and + characters contained in the string value of the cell specified by [PRO_CD], use the following:

  @num_of_listed_chars( "-+", [PRO_CD].Text)

@asc
(fusion_place >= 12.0)

1st argument

String: String to be converted

Converts full-width characters in the string to half-width characters. Targets include full-width alphanumeric characters, symbols and Katakana.

The 1st argument is the string to be converted.

For example, to convert full-width characters contained in the string value of the cell specified by [PRO_CD] to half-width characters, use the following:

  @asc( [PRO_CD].Text)

@jis
(fusion_place >= 12.0)

1st argument

String: String to be converted

Converts half-width characters in the string to full-width characters. Targets include half-width alphanumeric characters, symbols and Katakana.

The 1st argument is the string to be converted.

For example, to convert half-width characters contained in the string value of the cell specified by [PRO_CD] to full-width characters, use the following:

  @jis( [PRO_CD].Text)

Date Functions

Function Arguments
(If optional, enclose with [])
Description

@date

1st argument

String or Numeric: Calendar year

2nd argument

String or Numeric: Month number

3rd argument

String or Numeric: Day

[4th argument]

String or Numeric: Month offset

Returns a date serial number (integer). The date serial number is compatible with Excel date serial numbers[1]. Values passed to this function can be numeric (for example 2020) or strings (for example "2020").

By combining the month number and the month offset, you can easily obtain date serial numbers even when the fiscal year differs from the calendar year.

Example) Date serial number for April 1st in Fiscal Year 2020 with March year-end ( = 2020/7/1):

  @date(2020,4,1,3)

With a March year-end, the fiscal year end month is shifted by 3 months after the calendar year end, so MonthOffset = 3.

Example) Date serial number for April 1st in Fiscal Year 2021 with June year-end ( = 2020/10/1):

  @date(2020,4,1,-6)

With a June year-end, the fiscal year end month is shifted by 6 months before the calendar year end, so MonthOffset = -6.

If the month offset is not specified, it is treated as 0.

If any of year, month, day or month offset is invalid, or if the combination does not form a valid date, the error value #VALUE is returned.


1. However, Excel incorrectly treats the year 1900 as a leap year when calculating date serial numbers, so for dates on or before 1900/2/28, the values returned by this function are not compatible.

@year

1st argument

Numeric: Date serial number

Returns the calendar year of the date represented by the date serial number.

@month

1st argument

Numeric: Date serial number

Returns the calendar month of the date represented by the date serial number.

@day

1st argument

Numeric: Date serial number

Returns the day of the month of the date represented by the date serial number.

@day_of_week

1st argument

Numeric: Date serial number

Returns the day of the week of the date represented by the date serial number.

1

Monday

2

Tuesday

3

Wednesday

4

Thursday

5

Friday

6

Saturday

7

Sunday

@last_day_of_month

1st argument

Numeric: Date serial number

Returns the date serial number of the last day of the month to which the date represented by the date serial number belongs (considering leap years).

@week_anchor

1st argument

Numeric: Start date of the attribution period (date serial number)

2nd argument

Numeric: First day of the week (Monday: 1 Sunday: 7)

[3rd argument]

Numeric: Day of the week that determines the attribution period of the week (same as above)

Returns the date serial number of the first day of the first week when subdividing the attribution period into weeks, that is, the first day of Week 1.

Start date of attribution period

Specify the date serial number for the first day of the period (year, month and so on) to be divided into weeks.

First day of the week

Specify which day of the week is considered the first day when dividing into weeks.

Day of the week that determines the attribution period of the week

Specifies that the week containing the first occurrence of this day of the week within the attribution period is considered Week 1. If omitted, the week containing the start date of the attribution period is considered Week 1.

@week_num

1st argument

Numeric: Start date of the week sequence (date serial number)

2nd argument

Numeric: Target date (date serial number)

[3rd argument]

Numeric: Start date of the next week sequence (date serial number)

Returns the week number of the week that contains the target date in the week sequence starting from the start date of the week sequence.
The first week is Week 1.

If the “start date of the next week sequence” is specified, dates on or after that date are regarded as belonging to the next week sequence (for example, next year). In that case, 0 is returned.

Logical Functions

Function Arguments
(If optional, enclose with [])
Description

@is_error
(fusion_place >= 10.0)

1st argument

Any value

Determines whether the 1st argument is an error value. If it is an error value, returns True, otherwise returns False.

⚠ If you specify a cell range specifier [A] instead of an expression as the 1st argument, the result of this function will not be True even if the value in the cell range becomes an error. This is because the cell values are error values but the cell range itself is not an error value. Explicitly specify a member function such as [A].value or [A].total.

@iferror

1st argument

Any value

2nd argument

Value to return in case of error

If the 1st argument is an error value, returns the 2nd argument. Otherwise returns the 1st argument.

Example:

  @iferror([A]/[B], "-")

In the above example, if the value of [B] ([B].total) is zero and division by zero occurs, - is returned.

Error values include #DIV!/0 and #VALUE for numeric errors as well as #N/A for values of cells whose reading is prohibited.

⚠ If you specify a cell range specifier [A] instead of an expression as the 1st argument, the result of this function will not be True even if the value in the cell range becomes an error. This is because the cell values are error values but the cell range itself is not an error value. Explicitly specify a member function such as [A].value or [A].total.

Functions Available Only in Member Criteria Expressions

The relative_position function is provided for use with the built-in member lists of Fiscal Year and Relative Period. Use cases for the relative_position function are assumed to be rare, but if you need to use it, refer also to these built-in member lists.

The depth and height functions that are available only in Member Criteria Expressions are different functions from the functions with the same names that take arguments and are available in Form column expressions, row expressions and cell expressions, so be careful not to confuse them.

Function Arguments
(If optional, enclose with [])
Description

@relative_position

None

Returns the relative position of the current member with respect to the POV member.

Available only in Member Criteria Expressions for Fiscal Year and Relative Period dimensions.

@depth
(fusion_place >= 12.1)

None

Returns the depth of the member currently being evaluated in a Member Criteria Expression (current member). The starting point for calculating depth is the starting member of the member list (the depth of the starting member of the member list is 0).

Members that are skipped in Member Criteria Expressions are also considered when calculating depth.

@height
(fusion_place >= 12.1)

None

Returns the height of the member currently being evaluated in a Member Criteria Expression (current member). The starting point for calculating height is the lowest member of the member tree (the height of a lowest-level member is 0). The height of the other members is the maximum height of their child members plus 1.

Members that are skipped in Member Criteria Expressions are also considered when calculating height.

@find_in_path
(fusion_place >= 15.0)

1st argument

String: Member classification property label

2nd argument

String: Member classification property value

Starting from the starting member, searches along the path to the current member and returns the first member that meets the conditions specified by the 1st and 2nd arguments.

For how to specify the conditions, see Filtering Members by Member Classification Properties.
If the same member appears in multiple positions, each occurrence is treated as a distinct path, and evaluation is based on each path.
If no matching member exists, returns an empty member object.

For concrete examples, please refer to Q&A: @find_in_paht Function Samples (fusion_place >= 15.0).

For details of current member and POV member, please refer to Member Variables.

Functions Available in Form Column Expressions, Row Expressions and Cell Expressions

For details on where these functions are available, please refer to Dialects of Text Expressions.
Function Arguments
(If optional, enclose with [])
Description

@depth

1st argument

Dimension object or String

In the target column, row or cell, if the current member for the dimension specified by the 1st argument is supplied from the vertical or horizontal member list, returns the depth of that member within that member list (0-based). If there is no current member for that dimension or if it is not supplied from a member list, returns 0.

Depth is counted by skipping members that are under the starting member of the member list in the member tree but not included in the member list. For example, if there are three hierarchical members A > B > C, and the starting member A and its grandchild C are included in the member list but B is not, the depth of C is 1 (the depth of A is 0).

If the 1st argument is a string, it is treated as a dimension label.

@height

1st argument

Dimension object or String

In the target column, row or cell, if the current member for the dimension specified by the 1st argument is supplied from the vertical or horizontal member list, returns the height of that member within that member list (0-based). If there is no current member for that dimension or if it is not supplied from a member list, returns 0.

Height is counted by skipping members that are under the starting member of the member list in the member tree but not included in the member list. For example, if there are three hierarchical members A > B > C, and the starting member A and its grandchild C are included in the member list but B is not, the height of A is 1 (the height of C is 0).

If a member appears more than once in a member list, height is calculated separately for each occurrence.

If the 1st argument is a string, it is treated as a dimension label.

@translate

1st argument

Any object

2nd argument

Translation table label

In the target column, row or cell, converts any object to a string, then applies the specified Translation Table.
If an error occurs during translation, the following error values are returned:

If the specified Translation Table does not exist, #VALUE! is returned.

If there is no translation rule in the Translation Table that corresponds to the pre-translation value, #TR_ERR is returned.

If the translation result of the rule corresponding to the pre-translation value is #IGNORE, #IGNORE is returned.

Each error value is treated as an error by the @Is_Error function and the @IfError function.

Function Arguments
(If optional, enclose with [])
Description

@participant_label

None

Returns the label of the Participant that is reading or writing data.

Functions Available in Field Value Expressions

Function Arguments
(If optional, enclose with [])
Description

@field_key

[1st argument]

Numeric: Field index

Returns the Value Field Key specified for the Value Field currently being processed. Multiple Value Field Keys can be specified for a single Value Field separated by commas. The 1st argument of @field_key specifies which key to return (1-based).

If omitted, it is treated as if 1 were specified.

If a value less than or equal to 0 is specified, or if a number greater than the number of keys specified for the field is specified, or if a non-integer value is specified, this function returns an empty string.