Forum Discussion

Nigel_Mayhew1's avatar
1 year ago
Solved

Extract a reference from a column based on specific criteria

Hi there,   I need to extract a specific reference from a column:   Reference Result X201227638 null ZRET19/0014457 ZRET19/0014457 ZRET23/0003605 ( X201212911-1-Madone 838954920) ...
  • PhilipTreacy's avatar
    1 year ago

    Nigel_Mayhew1 

     

    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 null

     

     

    NOTE 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