Skip to main content

Text Functions


Text functions operate on string values. They are used to combine, transform, or evaluate textual data. These functions are common in projections, filters, and computations that involve string manipulation.

Usage

Text functions are defined using dedicated top-level expression forms, such as $concat.
These functions accept one or more expressions that evaluate to text.
Operands can include string literals, column references, or nested expressions.
They can be freely combined with other expression types and used anywhere expressions are allowed.

  • All inputs must be string-compatible.
  • If any operand evaluates to null, the entire result is null.
  • Evaluation proceeds from left to right.

$concat

Added in: indicate.dsl.dql@1.0.0
Concatenates multiple expressions using the || operator.

{
"$concat": [
{ object (Expression) },
{ object (Expression) },
...
]
}
Example:
{
"$concat": [
{ "$scalar": "Hello, " },
{ "$scalar": "world!" }
]
}

$lower

Added in: indicate.dsl.dql@1.0.0
Converts a string to lowercase.

{
"$fn": "lower",
"$operand": { object (Expression) }
}
Example:
{
"$fn": "lower",
"$operand": { "$scalar": "HELLO WORLD" }
}

$upper

Added in: indicate.dsl.dql@1.0.0
Converts a string to uppercase.

{
"$fn": "upper",
"$operand": { object (Expression) }
}
Example:
{
"$fn": "upper",
"$operand": { "$scalar": "hello world" }
}

$length

Added in: indicate.dsl.dql@1.0.0
Returns the number of characters in a string.

{
"$fn": "length",
"$operand": { object (Expression) }
}
Example:
{
"$fn": "length",
"$operand": { "$scalar": "Invoice-2024" }
}

$substring

Added in: indicate.dsl.dql@1.0.0
Extracts a substring starting at a specific position for a given length.

{
"$fn": "substring",
"$operands": [
{ object (Expression) },
{ object (Expression) },
{ object (Expression) }
]
}
Example:
{
"$fn": "substring",
"$operands": [
{ "$scalar": "ProductCode123" },
{ "$scalar": 1 },
{ "$scalar": 7 }
]
}

$replace

Added in: indicate.dsl.dql@1.0.0
Replaces all occurrences of a substring with another substring.

{
"$fn": "replace",
"$operands": [
{ object (Expression) },
{ object (Expression) },
{ object (Expression) }
]
}
Example:
{
"$fn": "replace",
"$operands": [
{ "$scalar": "I like apples" },
{ "$scalar": "apples" },
{ "$scalar": "oranges" }
]
}

$trim

Added in: indicate.dsl.dql@1.0.0
Removes leading and trailing whitespace from a string.

{
"$fn": "trim",
"$operand": { object (Expression) }
}
Example:
{
"$fn": "trim",
"$operand": { "$scalar": " cancelled " }
}