In the Data below i want to POL and corresponding value from Part so basically where ever is POL placed we need to get same number of value from part column:
Data:
Ops | Part |
key-ID-ISSUE-POL-COT | 856-658-985-963-458 |
key-ID-ISSUE-POL | 968-548-785-9635 |
key-ID-ISSUE-POL-COT-DT | 4563-568-475-96242-544 |
Result:
Ops | Part |
POL | 963 |
POL | 9635 |
POL | 96242 |
Solved! Go to Solution.
This formula should work:
GetPart([Part], "-", REGEX_CountMatches(REGEX_Replace([Ops], "(.*)(POL).*", "$1$2"), "-"))
Edit:
Revised WF attached. I split up the 3 formula parts into separate formula spots. It'll be easier to see each step's output (vs the final combined formula, which is what's above)
Forumla 3 and 4 (get part) is having an issue please check
I have managed to get the desired output exactly as you wrote. I hope this is what you are looking for.
Christiane_DSC is it doing by the position or if the position changes it will pick this regardless?
@eaglepath another method
@eaglepath - What error are you seeing with my formulas 3 and 4? It's working fine for me - happy to help troubleshoot your error if you show it!
Hi, @eaglepath
There is a formula of dynamic position for you: [ It can used in any version. ]
RegEx_Replace([Part], '^((?:[^-]*?\-){' + ToString(REGEX_CountMatches(Left([Ops], FindString([Ops], 'POL')),'-')) + '})(\d+?)(-.+|$)', '$2')
You use simple use (\d+ - \d+ - \d+ -) (.*) - (.*) and get the $2 Value in regex replace tool.