Forum Discussion

SamWiseOwl's avatar
SamWiseOwl
Icon for Super User rankSuper User
1 year ago
Solved

Splitting Names without separator

Hello folks! I feel like I am close to an answer but having Friday brain.   Client has a list of everyone who attended a call. These calls can be from departments and start with an extension numb...
  • dufoq3's avatar
    dufoq3
    1 year ago

    Hi SamWiseOwl, check this:

     

    Output

    let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XY1NC4JAFEX/ysN1LZTMdVoE9rGZwIW4eDlPefCcgTET/32DUYLLyzn33rIMUvuEI75ZK+zgVp8HdhRUmzLIqWkgt4b6OR605wqNFnJ3rq0QXFh3aDJBX4GU0M3iw3aQuYF7WsWUDKgXix/4HrAn6BxNqxiFSbwdfcOOUpDRExS/tUXa76K/NKMrtShwwlYoiZNwYdUH", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Names = _t]),
    ChangedType = Table.TransformColumnTypes(Source,{{"Names", type text}}),
        Ad_NamesWithSeparator = Table.AddColumn(ChangedType, "Names with Seperator", each 
            [ a = Text.Combine(Splitter.SplitTextByCharacterTransition({"a".."z"}, (x)=> not List.Contains({"a".."z", " "}, x))([Names]), "|"),
              b = Text.Replace(a, "Mc|", "Mc")
            ][b], type text)
    in
        Ad_NamesWithSeparator