Skip to content

{{substring}}

Returns the part of the input after a delimiter, comparable to SQL’s SUBSTRING(input, CHARINDEX(delimiter, input) + 1, ...). If the delimiter doesn’t occur in the input, the input is returned unchanged.

An optional third argument selects which occurrence of the delimiter to cut at (1-based; the default is the first).

{{substring input delimiter [occurrence]}}

Stripping a Data Vault prefix from an object name:

{{substring "HUB_CUSTOMER" "_"}}

This results in:

CUSTOMER

With a multi-part name, the default first occurrence keeps everything after the prefix (LNK_CUSTOMER_COSTING becomes CUSTOMER_COSTING), while passing 2 as the occurrence would return only COSTING. The sample solutions use this together with conventions, for example to derive a surrogate key name:

{{substring dataObject.name '_' 1}}_{{conventions.surrogateKeyIdentifier}}