I have a need to create a function the will return nth element of a delimited string.
For a data migration project, I am converting JSON audit records stored in a S
@a - the value (f.e. 'a/bb/ccc/ffffdd/ee/ff/....')
@p - the desired position (1,2,3...)
@d - the delimeter ( '/' )
trim(substring(replace(@a,@d,replicate(' ',len(@a))),(@p-1)*len(@a)+1,len(@a)))
only problem is - if desired part has trailing or leading blanks they get trimmed.
Completely Based on article from https://exceljet.net/formula/split-text-with-delimiter