COLS2LISTMAP¶
The COLS2LISTMAP function collapses columns into a single column, similar to COLS2LIST, applying an expression to each value as it combines to a list with a separator between the values. The separator defaults to “,”, but can be set to anything, with the optional separator argument.
Usage¶
COLS2LISTMAP(string, string[, sep]) : string
Example¶
gor ... | CALC test COLS2LISTMAP('cols*', 'lower(x)')
test
now contains the values in lowercase from all columns starting with ‘cols’, separated by commas.
gor ... | CALC test COLS2LISTMAP('cols*', 'lower(x)', ':')
test
now contains the values in lowercase from all columns starting with ‘cols’, separated by colons.
gor ... | CALC test IF(CONTAINS(COLS2LISTMAP('cols*', 'lower(x)'), 'foo'), 1, 0)
test
now contains 1 if any of the values from all columns starting with ‘cols’ contain the string ‘foo’.