Forum Discussion
"Does Not Contain" is picking up null values
Hi Jeffrey2 ,
Try this instead:
Table.SelectRows(#"Filtered Rows1", each not Text.Contains([Comments], "Duplicate") or [Comments] = null)
Pete
- Jeffrey24 years ago
Helper I
Thanks BA_Pete . The logic doesn't really make sense to me, but it fixed the problem.
- BA_Pete4 years ago
Super User
You're giving the the SelectRows function a choice: either give me something that doesn't contain "Duplicate", or give me a null.
However, this is a very narrow example-case, so the logic may fall over with a broader sampleset.
For example, what happens when you have rows that otherwise match, but one has "Whatever" in [comments], and the other has null. Both of these rows will be retained using this logic - is this what you want/need?
Pete
- Jeffrey24 years ago
Helper I
I just want to get rid of rows that have the word "Duplicate" in the Comments field. Keep all other rows. If the row had "a;dlkfja;lkdfj;ladkjf;alkjfd;lakfj" I want to keep it. If a row had "adsf;lkaj;lsfkja;lkjfadsf Duplicate" , I want it removed. If a row had null, I want to keep it.
I just think Table.SelectRows(#"Filtered Rows1", each not Text.Contains([Comments], "Duplicate")) should have been enough. To me this is a program error.