Forum Discussion
MStaford
1 year agoRegular Visitor
Case insensitive table.findtext across multiple columns
Hi All, I have a situation where I have to bring across only those rows where a specific values specific value (lets say, "true") appears in 5 selected columns with multiple files with each includi...
- 1 year ago
Hi MStaford
Still using the same code in my initital post but changing List.AllTrue to List.AnyTrue to check if at least one of the column values contains the word true..
let // Step 1: Define a list of values, replace with the actual column names ColumnsAsAList = {[bla1], [yaba2], [daba3], [lama], [doo]}, // Step 2: Convert each value in the list to a logical (true/false) ChangedType = List.Transform(ColumnsAsAList, Logical.From), // Step 3: Check if all values in the list are true. Use List.AnyTrue to return true if any of the values in the list is true TrueOnly = List.AnyTrue(ChangedType) in TrueOnly
ryan_mayu
1 year agoSuper User
you can try this to create a new column to check.
= Table.AddColumn(Source, "Custom", each
[a=List.Skip(Record.ToList(_)),
b=List.RemoveItems(List.Transform(a, each Text.Lower(_)),{"true"}),
c=if List.Count(b) = 0 then true else false]
[c]
)
pls see the attachment below