Forum Discussion
Select Rows if text Contains (Value of a list)
- 6 years ago
aoliver here is how you can do it
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTQVXBILE5JU4rViVYyAvEsiorAHGMgx8zcBMw2AbINjYwNHYyVYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", (x) => List.MatchesAny(SearchList, each Text.Contains(x[Column1], _))) in #"Added Custom"here is the query for SearchList
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcrBQitUBUsZKsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}), Column1 = #"Changed Type"[Column1] in Column1Would appreciate Kudos 🙂 if my solution helped.
aoliver here is how you can do it
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTQVXBILE5JU4rViVYyAvEsiorAHGMgx8zcBMw2AbINjYwNHYyVYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", (x) => List.MatchesAny(SearchList, each Text.Contains(x[Column1], _)))
in
#"Added Custom"
here is the query for SearchList
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcrBQitUBUsZKsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
Column1 = #"Changed Type"[Column1]
in
Column1
Would appreciate Kudos 🙂 if my solution helped.
- aoliver6 years agoHelper III
Amazing, this is exactly what I looking for, THANKS!
- aoliver6 years agoHelper III
Sorry for mention you again, my problem has changed a little:
It is possible to filter 2 times in 2 different columns? Let me explain with an example:
My table
ID - STATUS 1 - STATUS 2
1 - TD - #82 - TD - #5
3 - TM - #5
I want to filter with AND not with Any, for example (in my list)
List 1 List2
TD #8
TM #5
So, List1 filters status1 and List 2 filters status2,
so the result would be
2 - TD - #5There is a problem: the value of the list is not the whole value of status columns, its just a part of it.
Have the example sense? Any ideas?
Ive tried to create 2 conditional columns but that is a OR not an AND, in logical forms.Thanks again