Filter DataTable with multiple conditions

datatable
studio

#1

So far all the guide and post I see online only has a single condition like dt.Select("[ColumnX]=‘Test’"). Is there a way to filter out the dataTable with 2 conditions, for example, dt.Select("[ColumnX]<>‘Test’") and dt.Select("[ColumnX]<>‘Sample’"). I have tried it out personally and I can’t seem to get it working.


#2

@poogy112
Try this:
dt.Select("[ColumnX]<>‘Test’ and [ColumnX]<>‘Sample’")


#3

@poogy112, To make it more simpler use this dt.Select("[ColumnX] Not in (‘Test’,‘Sample’)"). You can add multiple conditions here.

Regards,
Dominic :slight_smile:


#4

@599712
Concise and better syntax than my suggestion, thanks!:grinning:


#5

@hojoong.kim
@Dominic,
@poogy112
Hi,

I need to filter the Data table with multiple filter values/arguments ,

I tried below syntax, but getting error .Please let me know any one.

I’m uploading some images for references(Actually I need to filter more than 5 values )

multipleImage2