Forum Discussion
Anonymous
6 years agoNot applicable
Return the match from List.ContainsAny
I'm using the following to check a list of products in a string against a list from a table: if List.ContainsAny(Text.Split([ProductsList],"|"),#"ExceptionProducts"[Product]) then 1 else 0 This ...
- Anonymous6 years ago
try this
let Source = tab, l2={"ABD","ABJ","ABF"}, #"Added Custom1" = Table.AddColumn(Source, "Exception", each let l1=Text.Split([ProductList],"|"),p=List.PositionOfAny(l1,l2,Occurrence.First) in try l1{p} otherwise null) in #"Added Custom1" - Anonymous6 years ago
another way, may be cleaner, could be this which use a user defined function:
let Source = tab, l2={"ABD","ABJ","ABF"}, #"Added Custom1" = Table.AddColumn(Source, "Exception", each extract_exception([ProductList],l2)) in #"Added Custom1"
Anonymous
6 years agoNot applicable
another way, may be cleaner, could be this which use a user defined function:
let
Source = tab,
l2={"ABD","ABJ","ABF"},
#"Added Custom1" = Table.AddColumn(Source, "Exception", each extract_exception([ProductList],l2))
in
#"Added Custom1"
Anonymous
6 years agoNot applicable
Anonymous Great solutions. Thanks for your help