Array functions
This page goes over the array functions in Upsolver.
ARRAY_JOIN
ARRAY_JOINConcatenates all values into a single string, separated by the separator.
Syntax
ARRAY_JOIN(SEPARATOR, VALUES)
Examples
Values
"a", "b", "c"
5.5
"a", "b", "c"
ARRAY_MAX
ARRAY_MAXReturn the maximum value in an array.
inputs
result
1, 0.2, 30
30
ARRAY_MIN
ARRAY_MINReturn the minimum value in an array.
inputs
result
1, 0.2, 30
0.2
ARRAY_SUM
ARRAY_SUMSums all the values in the array.
inputs
result
1, 0.2, 30
31.2
CONCAT
CONCATReturns an error message indicating that CONCAT has been deprecated.
COUNT_VALUES
COUNT_VALUESReturns the amount of items in a given array.
input
result
0
"a", "b", "c"
3
COUNT_VALUES_IF
COUNT_VALUES_IFReturns the amount of true values in a given array.
input
result
0
true, false, true
2
DISTINCT_VALUES
DISTINCT_VALUESGet all the distinct elements in the array.
input
result
1, 2, 3, 4, 4, 1
1, 2, 3, 4
ELEMENT_AT
ELEMENT_ATGets the element at the given index in the array.
Properties
Index - The index of the item to return
input
Index
result
"a", "b", "c"
1
"b"
"a"
1
null
"a", "b", "c"
-1
null
FIRST_ELEMENT
FIRST_ELEMENTGets the first element in the array.
input
result
null
"a", "b", "c"
"a"
LAST_ELEMENT
LAST_ELEMENTGets the last element in the array.
input
result
null
"a", "b", "c"
"c"
LEAST
LEASTReturn the minimum value.
input
result
[1, 0.2], [30]
0.2
PRESTO_CONCAT
This function returns the concatenation of the arguments. It provides the same functionality as the SQL-standard concatenation operator (||).
Syntax
PRESTO_CONCAT(STRING1, STRING2, ..., STRINGN)
Arguments
STRING# An expression to concatenate.
Returns
The concatenation of the arguments.
Examples
Strings
Result
"a", "b", "c"
"abc"
"1", "2" , "A", "B"
"12AB"
Last updated
Was this helpful?