Forum Discussion

ysherriff's avatar
ysherriff
Resolver II
3 years ago
Solved

M Code to extract between characters that are not same position

Hi all,

Does anyone know how to extract the year from this text string? I trired "Text Extraction" and "Delimiter" but it is not coming out the way I want.

I want the year in one column but I am also showing "Gen".


Thank you for your help

 

 

  • Thank you but this solution works


    List.RemoveNulls (
    List.Transform (
    Text.Split ( _[Campaign Name], "-" ),
    each try Number.From ( _ ) otherwise null
    )
    ){0}

     

     

     

2 Replies