Forum Discussion
tstraker
6 years agoFrequent Visitor
Text.Contains Error "cannot convert the value [string] to type logic"
Hi, I'm trying to createa calculated column that will search [application names] and tag those can contain certain text. My attempt is below: operations tag = if(Text.Contains([Applicat...
- 6 years ago
Hi,
Does this M language formula do the job?
=if Text.Contains([Application Name], "CIP1")=TRUE or Text.Contains([Application Name], "ETL")=TRUE or Text.Contains([Application Name], "OPS")=TRUE then "Operations Component" else null
kentyler
Solution Sage
6 years agoThis is from the example for text.contains
EVALUATE
ROW(
"Case 1", CONTAINSSTRING("abcd", "bc"),
"Case 2", CONTAINSSTRING("abcd", "BC"),
"Case 3", CONTAINSSTRING("abcd", "a*d"),
"Case 4", CONTAINSSTRING("abcd", "ef")
)
You might use something likeif(
OR(
OR(CONTAINSSTRING([Application Name], "CIP1"),CONTAINSSTRING([Application Name],"ETL"),
CONTAINSSTRING([Application Name], "OPS"),
"Operations Component,
"")