Problem of filtering data

After I add filter activity, although the robot is work, it is not my expected result.

May i ask how I can 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:

However, after I use filter activity

The result of “within range” sheet is:

“Outrange” sheet is:

Can anyone help me revise the current result to my expected one? Many thank

Workflow:
Main MU-bias in-outrange.xaml (50.9 KB)
Excel
WB templ. 27.2.24.xlsx (85.5 KB)

Hi @Happydayyy

If you want to read certain filtered data and write it to another sheet then use below solution

  1. Use read range activity to read the excel sheet ==> Output variable is ‘exceloutput’
  2. Create a assign variable as 'filteredRows = exceloutput.Select(“Type = ‘3N’ OR Type = ‘4N’ OR Type = ‘KR’ OR Type = ‘Kw(Pd)’ OR Type = ‘Kw(Ni)’ OR Type = ‘Ky’”).CopyToDataTable()
  3. You can write the filtered data to an excel sheet using write range activity.
  4. For the data other than mentioned values use below expression
    filteredRows = exceloutput.Select(“NOT (Type = ‘3N’ OR Type = ‘4N’ OR Type = ‘KR’ OR Type = ‘Kw(Pd)’ OR Type = ‘Kw(Ni)’ OR Type = ‘Ky’)”).CopyToDataTable()
  5. Write the filtered data in new sheet using write range activity

Hope this solutions for you.


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

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

Hi @Happydayyy

Please find the sample code which will resolve your issue

MU-bias_new.xaml (9.1 KB)

Please let me know if any further help required

1 Like

Thanks you very much!!!

1 Like

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