Hi, i want to extract the nth split by delimiter '_', i was trying with an IF statement on the B column IF [bp]=A THEN .....
but i'm struggling with the regex functions.
Any help appreciated, Thanks
Solved! Go to Solution.
@jcardoso - Probably a few ways to approach this, depending if it's the same nth split that you want to parse out every time or if it's more of a pattern that you're looking for.
The sample provided doesn't have the "bp" column, so any additional info you can provide can help us give a better response.
Hello @jcardoso ,
I think this does the trick:
These are the formulas:
IF REGEX_Match([FileName], '(.*\_)(\d{7,8})(\_.*|\.xlsx)') THEN REGEX_Replace([FileName], '(.*\_)(\d{7,8})(\_.*|\.xlsx)', '$2') ELSE Null() ENDIF
IF IsNull([awdad]) and REGEX_Match([FileName], '(.*\_)(\d{4}\-\d{2}\-\d{2})(\s.*)') THEN REGEX_Replace([FileName], '(.*\_)(\d{4}\-\d{2}\-\d{2})(\s.*)', '$2') ELSE [awdad] ENDIF
IF IsNull([awdad]) and REGEX_Match([FileName], '(.*\_)(\d{4}\-\d{2}\-\d{2})(\_.*)') THEN REGEX_Replace([FileName], '(.*\_)(\d{4}\-\d{2}\-\d{2})(\_.*)', '$2') ELSE [awdad] ENDIF
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards
You might find my set of custom formulas useful. It includes a Split() function and a StandardDate() function that might be useful as well.
https://community.alteryx.com/t5/Alteryx-Designer-Ideas/Custom-Functions/idi-p/467216
Thank you afv2688
although this would need to be adapted to each of the different date formats, yes, it solves the case.