The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
How to replace/remove text between delimiters when there are multiple delimiters ?
Case :
value on the cell :
aaa
bbb
ccc
eee
aaa
bbb
ccc
eee
aaa
bbb
ccc
xxx
eee
aaa
bbb
ccc
eee
aaa
bbb
ccc
xxx
eee
....
I am looking to remove only the values in red.
Thanks!
up
guess!!!
NewStep=Table.Combine(Table.Group(PreviousStepName,"Column1",{"n",each Table.RemoveLastN(_,each [Column1]<>"bbb")},0,(x,y)=>Byte.From(y="xxx"))[n])
Hello Daniel,
Thanks for your try.
This doesn't seem to work it erases all the value 😞
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSkxMjMmLyUtKSgJRycnJICo1NRVEkSxXUVFBHe1KsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Colonne 1" = _t]),
#"Type modifié" = Table.TransformColumnTypes(Source,{{"Colonne 1", type text}}),
#"Colonnes renommées" = Table.RenameColumns(#"Type modifié",{{"Colonne 1", "Column1"}}),
NewStep=Table.Combine(Table.Group(#"Colonnes renommées","Column1",{"n",each Table.RemoveLastN(_,each [Column1]<>"bbb")},0,(x,y)=>Byte.From(y="xxx"))[n])
in
NewStep
NewStep= Table.TransformColumns(Source,{"Colonne 1",each let a=Table.FromList(Splitter.SplitTextByWhitespace()(_),each {_}) in Text.Combine(Table.Combine(Table.Group(a,"Column1",{"n",each Table.RemoveLastN(_,each [Column1]<>"bbb")},0,(x,y)=>Byte.From(y="xxx"))[n])[Column1],"#(lf)")})
Hello Daniel,
I tested but only the first occurrence is removed, and in the next pattern it's the end delimiter that is removed.
rather, everything after the start delimiter is removed with the second occurence.