Forum Discussion
Extract a reference from a column based on specific criteria
- 1 year ago
OK try this, works for me
= try List.Select(Text.Split(Text.Range([Reference], Text.PositionOf(Text.Upper([Reference]), "ZRET")), " "), each Text.Contains(_ , "ZRET")){0} otherwise nullNOTE that in the 2nd lot of data you provided the 3rd line that begins Durchg mit gives a null becuase the code has a typo - it's ZRTE instead of ZRET. I corrected this in my new example.
Regards
Phil
Hi Phil,
That's absolutely perfect. Thank you!
Would you be kind enough please to just tell me what exactly I must change in the code if in the future I needed to look for strings other than ones starting with 'ZRET'?
For example if the strings were to begin with X5, L8 and Z1 and are 10 characters long.
Very much appreciated!
Best,
Nigel
If you are just looking for one type of string at a time you just need to chnage any occurrence of ZRET in my code to X5, L8 etc.
However if you need to look for ZRET and X5 and L8 etc at the same time, you'll need different code.
If you can supply some example data I can show you.
Regards
Phil