Hi, I have a string dim that I need to find the first to last word and it’s semicolon separated. Example: List = “once;twice;threetimes;ninetimes;eight;finallist;” I need to return : “eight”
source is BigQuery and the field always ends with a “;”
I’d recommend writing some regex and use REGEXP_EXTRACT
in bigquery
I think you could use liquid html to
Assuming you want to do it in-model/in-BQ, I’d try something like: ARRAY_REVERSE(SPLIT(${your_string_dimension},";"))[SAFE_OFFSET(2)]
I’ve used an offset of 2 because the last string returned by SPLIT would always be the empty string after the final ;
This worked nicely. Thank you!