Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Trim Text before second delimiter

Hi, 

 

I have a list of products as below. I wish to truncate the "(X-YZ)-" and "(AB-D)-" from the name.

How can I do it?

 

Product (Before)

(X-YZ)-FRIDGE

WASHING MACHINE

(AB-D)-DRYER

IRON

Product (After)

FRIDGE

WASHING MACHINE

DRYER

IRON

 

  • Try extracting text after rightmost delimiter:







    Br,
    J

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

     

    What you can try in PowerQuery is use: Text.AfterDelimiter(Product, "-", {0, RelativePosition.FromEnd})

  • tex628's avatar
    tex628
    Community Champion

    Try extracting text after rightmost delimiter:







    Br,
    J

  • Anonymous's avatar
    Anonymous
    Not applicable

    I don't think it's the most efficient way but you could do this using power query. 

     

    Add conditional column, Merge, then split by a delimiter.