LEN
- LEN(value)[source]
Returns the length of a string or the number of digits in a numeric value.
For strings: returns the number of characters.
For numbers: returns the number of digits in the integer representation.
For arrays: returns an array of lengths for each element.
- Parameters:
value (
Operand|str|int|float) –The value to measure.
Supported types:
INTEGER
DECIMAL
STRING
INTEGER_ARRAY
DECIMAL_ARRAY
STRING_ARRAY
- Return type:
- Returns:
A formula representing the length(s) of the input value(s).
Supported types:
INTEGER
INTEGER_ARRAY
- Raises:
ValueError – If the input value’s data type is not one of the supported types.
Examples
Single string:
LEN("Hello") # Returns 5
Single number:
LEN(12345) # Returns 5
Array of strings:
LEN(["Hi", "Test", "A"]) # Returns [2, 4, 1]
Array of numbers:
LEN([12, 345, 6]) # Returns [2, 3, 1]