MicroStrategy ONE

Factorial

Returns the factorial of a positive integer. The factorial of an integer N is equal to the product of all integers from 1 to N. For example, the factorial of 5 is 1 × 2 × 3 × 4 × 5, or 120.

This is a single-value function.

Syntax

Factorial(Argument)

Where:

Argument is a metric representing a list of positive integers.

Usage Notes

If a number is not an integer or is negative, the function returns a NULL.

Example

These simple examples illustrate the results of using the Factorial function.

Function/Result Calculation

Factorial(5) = 120

5 × 4 × 3 × 2 × 1=120

Factorial(Argument) = 6, 5040, 362880 where Argument contains the values 3,7,9

1 × 2 × 3 = 6;

1 × 2 × 3 × 4 × 5 × 6 × 7 = 5040;

1 × 2 × 3 × 4 × 5 × 6 × 7 × 8 × 9 = 362880