Forum Discussion

Alexjaco2's avatar
Alexjaco2
New Member
2 years ago
Solved

Removing 3 digit numbers from a list

Hi All, 

I have a list of numbers (stored as texts) that are semi colon sepearated and I need specific 3 digit values removed. Is there any Power Query that can do this? Here is what I have and what I need. 

HaveWant
9083290832
9921399213
9921399213
9921399213
9921499214
9921499214
636 90750 ; 771 9047190750 ; 90471
9921399213
9921499214
914 9079190791
9921499214
636 90674 ; 771 9047190674 ; 90471
9921499214
9921499214
301 80050 ; 301 80061 ; 301 82607 ; 780 Q301480050 ; 80061 ; 82607 ; Q3014
  • Alexjaco2 Maybe this?

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fc2xDYAwDATAVazUFO/Y2ImYgjrK/mvgIGiiQHey/P+tpYoiOfUtVDPLr3SSiVGF76CD3Dmszt851vFdedlirsuWeVPAVIB787Hx62zw0VJAZxwi0S8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Have = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Have", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select(Text.Split([Have], " "), each Text.Length(_) <> 3)))
    in
        #"Added Custom"

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Alexjaco2 Maybe this?

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fc2xDYAwDATAVazUFO/Y2ImYgjrK/mvgIGiiQHey/P+tpYoiOfUtVDPLr3SSiVGF76CD3Dmszt851vFdedlirsuWeVPAVIB787Hx62zw0VJAZxwi0S8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Have = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Have", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select(Text.Split([Have], " "), each Text.Length(_) <> 3)))
    in
        #"Added Custom"