How to Filter Two or More Items from a columns in Datatable

Hi @Yameso Thank you your time.
With the expression you just sent me.
The second customer did not return. Aslo, it returned data from another Warehouse Id.
Can you look into it once more? Thanks!

give a try at:

(From d in dt_DataSource.AsEnumerable
Where {"PACIFIC SUNWEAR OF CALIFORNIA","CALISUN" }.Any(Function (x) d("Customer Name").ToString.Trim.ToUpper.Equals(x))
Where d("Warehouse Id").ToString.Trim.Equals("09") 
Where CDate(d("Start Dt").ToString).Date.Equals(CDate("04/01/2023").Date)
Select r =d).CopyToDataTable


I think the above expression has compiler’s error!
It alarts error


What is the variable x
seems has not been declared. Thanks!

updated the statement

That’s already part of the expression/ Query.

Yes the corrected one

Also validating

Hi @Sisay_Dinku
Give a try to this.

dt_DataSource.AsEnumerable.where(function(x) (x(“Customer Name”).ToString.Equals(“PACIFIC SUNWEAR OF CALIFORNIA”) Or x(“Customer Name”).ToString.Equals(“CALISUN”)) And x(“Warehouse Id”).ToString.Equals(“09”) Andalso DateTime.parseExact(x(“Start Dt”).ToString,“MM/dd/yyyy 00:00:00”,system.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”).Equals(“01/04/2023”)).CopyToDataTable

Hope this helps

Thank you, the error has gone but I still see data from only one customer.
What could be the cause?
I want to get data from the two customers but from the same Warehouse Id.
every time we make the combination of customers, we fix the warehouse Id to the same.
Sample_Data.xlsx (15.3 KB)

Thank you!

@Suraj_B_Shetty I gave that a try, it did not return data for both customers.

When shared excel is the source:

there are no CALISUN customers

@ppr This is another sample data. you can choose any of the two customers and return data from both.

you can choose

we can better support when working with the same sources

As an alternate you can check the filtering on a smaller test set where the result is better to force for the testing

Hi @Sisay_Dinku

I was able to get the both data using same query. Check this workflow.
Sequence1.xaml (6.6 KB)

Output - refer sheet1
Sample_Data.xlsx (16.6 KB)

Hope this helps

@Suraj_B_Shetty In my case, I keep on getting data only from the one customer. Can you take the other ones and give it a try?


Share the input file which you are using and names to be filtered.

Sample_Data.xlsx (15.3 KB)
@Suraj_B_Shetty see this attachment.

@Suraj_B_Shetty ignore CALISUN and use the ones you see in the sample data. Thanks!