Error of assigning the filter table

There is an error of assign the filter table, Can anyone help me to check on it and revise the path using my workflow? Thanks!

I need to classify the data based on “Type of sample” to different sheet.

This is the main sheet:

If the those data’s “Type” is 3N, 4N, KR, Kw(Pd), Kw(Ni), Ky, then all data will go to sheet “MU-bias (Within Range)”, like this sample:

But if those data’s “Type” other than 3N, 4N, KR, Kw(Pd), Kw(Ni), Ky, then all data will go to sheet “MU-bias (OUT Range)”, like this sample:

Workflow
Main MU-bias in-outrange.xaml (45.0 KB)
excel
WB templ. 27.2.24.xlsx (85.5 KB)

Hi @Happydayyy

Retype double quotes

Hai @Happydayyy

Remove the double quotes and re-type it do not copy and paste it.

After i retype “”, there is another issue. May I ask why happen this?

Hi @Happydayyy

Try with the below query once:

Maintb.Select("Type = '3N' OR Type = '4N' OR Type = 'KR' OR Type = 'Kw(Pd)' OR Type = 'Kw(Ni)' OR Type = 'Ky'").CopyToDataTable()

Regards

How about


How I can revise the outrange one?

@Happydayyy

Can you try with Filter Data Table activity

This one I try before, the result will be


Yet, my expected result is:

Therefore, I am trying to use the assign activity

we can shorten it with LINQ

Assign Activity
dtFiltered =

From d in Maintb.AsEnumerable
Let arrFilter = new String(){"3N", "4N" , "KR" , "Kw(Pd)" , "Kw(Ni)" , "Ky"}
Let chk = arrFilter.Contains(d("Type").toString.Trim)
Where not chk
Select r = d)).CopyToDataTable()

Handling empty Filter Results

Also when working with the Select Function (which is not the Select Operator) we do have the IN statement

There still has an error

How i can revise it?

this seems too difficult for me, I prefer a simpier one although it is longer


Do u know how i can solve this issue using this method?

the used syntax is not the needed syntax

how can i revise it?
Maintb.Select(“Type of sample = ‘3N’ OR Type of sample = ‘4N’ OR Type of sample = ‘KR’ OR Type of sample = ‘Kw(Pd)’ OR Type of sample = ‘Kw(Ni)’ OR Type of sample = ‘Ky’”).CopyToDataTable()
Thank you!

Can anyone share the workflow to me so that i can have a look on how to write on it. Thanks!!!

https://www.csharp-examples.net/dataview-rowfilter/

grafik

Can you illistrate me how I can revise the error assign activity? The link seems cant work in my case

because the output should be like this:

@Happydayyy
the link is about the Syntax (was also used longertimes by Microsoft itself within their help pages)
the screenshot above shows that it is working

we can also swap the not:
grafik

Rnd can you do within the debugging panels:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

So all power and Building blocks are with you


I added, but there is still an error

Can anyone show me an example workflow in my case? Many thx!