fieldr

fieldr(haystack: text, separator: text, index: number) 🡒 text, const pure function

Returns the nth field, zero-indexed from the right, in a text value that contains multiple sub-text value separated by a specified separator.

haystack = "a-b-c-d-"
show summary "" a1c3 with
  fieldr(haystack, "-", 0) // returns ""
  fieldr(haystack, "-", 1) // returns "d"
  fieldr(haystack, "-", 2) // returns "c"

This function is intended to facilitate parsing values that have been concatenated within a single table column.

See also

User Contributed Notes
0 notes + add a note