Forum Discussion

msantillan's avatar
msantillan
Icon for Helper II rankHelper II
6 years ago
Solved

Get the Text between delimitters from two columnsc M query

Is it possible to get the text between delimitters based from two columns?

I have this attempt code as an example:

 

Text.BetweenDelimiters(([Try1] and [Try2]), "try_", "_code")

 

Basically, I have two collumns which contains countless rows of either try_(get)_code and try2_(get)_code, and I only want to get the value of "(get)" from those in between try and code. Do note that (get) may vary and is just an example. The code above doesn't work. Any ideas?

  • Anonymous's avatar
    Anonymous
    6 years ago

    msantillan 

    You can just used the extact feature in query editor.

     


    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

     

    If you want, you can do it in edit query.

    Create a blank query any type in this query in advanced editor so you can see the logic.

     

    let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKimqjE8sTgEjJR0lQyPj+OT8lFSlWB2IHFDA0AgoYW5hboEqA9RibAKUychKz8DQAxTPz8zPRBVPKk5JMwTKmJqYQSViAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Try1 = _t, Try2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Try1", type text}, {"Try2", type text}}),
    #"Inserted Merged Column" = Table.AddColumn(#"Changed Type", "Merged", each Text.Combine({[Try1], [Try2]}, ""), type text),
    #"Extracted Text Between Delimiters" = Table.TransformColumns(#"Inserted Merged Column", {{"Merged", each Text.BetweenDelimiters(_, "_", "_"), type text}})
    in
    #"Extracted Text Between Delimiters"

     

    /Adam

  • Anonymous's avatar
    Anonymous
    Not applicable

    msantillan 

    You can just used the extact feature in query editor.

     


    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.