How To filter Not Null vaulue in

Hi! friends
I’m trying to do filtering in assign using
If there are columns [A] to [D],
I want to include column A as mandatory and bring only non-null rows for [B] or [C] or [D]
(In summary, column A will be searched for with a specific value, and if there is a value in at least one of B, C, and D, it will be retrieved)

“”[A] = ‘ABC’ And [B] = IS NOT Null or …“)” I did this, but the filtering doesn’t work well.

How should I use .select?

Hi @testbb

Can you try this

dt.AsEnumerable().Where(function(x) x("A").ToString.Equals("ABC") And (Not IsNothing(x("B")) Or Not IsNothing(x("C")) Or Not IsNothing(x("D")))).CopyToDatatable



Equal operator (=) is not necessary with IS NOT operator. So the expression will be as the following.

dt.Select("[A] = 'ABC' AND [B] IS NOT NULL")


Hello Yoichi!
thank you
Can I ask you just one more question?
I want to know if the value “A” exists as a header in the DataTable or not.
What should I do?


We can check it using the following expression.



thank you!

1 Like


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.