I have string ( "-" ) delimited data (alphanumeric, variable length) in a single column which has the format...
Column A
"aaa-bbb-ccc"
"ddd-bbb-eee"
"aaa-fff-ggg"
I have been able to use array_constrain() to return partial data elsewhere but this is N elements from the beginning of the array to the end of the array so I could have...
aaa (num_cols = 1)
aaa-bbb (num_cols = 2)
aaa-bbb-ccc (num_cols = 3)
I am looking to get the last N elements from the split data so...
bbb-ccc OR
ccc
num_cols only goes from the beginning of the array to the back of the array so that's no good for my scenario.
This answer to a similar question suggests using regexextract() to retrieve the last value which if my RegEx Foo was stronger then perhaps I could make that work with a little nudge in the right direction.
I know that index() can be used but that only returns one element at a time from the split data so that gets messy / inefficient.
So the question is does anybody know how to return the last N elements from an array? Ordinary sorting wouldn't work but reversing the array could work.