Filter Excel Table


#1

I’ve already looked at all topics in this forum about this issue… But i still cant get this right.

I would like to know how can i filter an Excel table, that in the “Minutes” column has several values. And I only want an excel table with “Minutes” above 2000!

I aprecciate your help,

Cumps


#2

You can get into a datatable and perfrom below query

dtMinutes.Select("Minutes >2000")

If you want to perfrom this on the excelsheet you need to sort by minutes and remove which every is less than 2000.


#3

Thanks for the answer. I have already tried it, but the thing is That after performing the select it Will return a datarow array. And i cannot put That in another excel sheet, right? The second solution you gave i Will indeed test it :slight_smile: but the first one, if it works Will give better performance i guess!


#4

Hello,

thank you for your inquiry

two things,

1st. Why not using click activity and type into activity on the excel you are trying to automate.
2nd. Why not using the excel scope activity an run a macro on it?

regards,

here is an XAML but you might want to change the selector name*
COPY_INV_INI.xaml (7.9 KB)


#5

Attached is the code

CopyDataTable.xaml (9.4 KB)


How to filter data in a particular excel sheet based on a column and save only the valid rows into the same excel sheet
How to convert my .Net oledb code to XAML and import in UiPath
#6

@vvaidya thank you for sharing man :slight_smile: what about a 343385 lines data with 12 columns ? ´cause right now I need to filter a column like this:

Centro
GM03
GM21
GM22
GM23
GP01
GP07

would you say that the performance would be better.? the reason I’m asking is that I need to filter a range of centers

GM01 GM02
GM03 GM03
GM04 GM04
GM12 GM13
GM20 GM30
GM31 GM39
GM40 GM55
GM62 GM62
GP00 GP07

many thanks


#7

Give a shot and see how long both robots are taking and which is less error prone.


#8

Ok… I’m on it man, many thanks :slight_smile:


#9

Try to do in an Isolated work flow if you have many rows to avoid app crash.


#10

Thank you all for the help! It worked smoothly :grin:


#11

Hi vvaidya,

In this workflow, you used ImportRow as method name in invoke method activity. Where you declare this method or is it Built in method ?

Thanks & Regards,
Lakshman.


#12

Correct


#13

I have used the CopyDataTable.xaml as reference and created a filter. I realized that duplicate records are also copied to the end excel.

Actual filter on excel returns :2 rows
Using Select :3 rows

First row is copied twice

Please help on this . I dont want duplicate records.


#14

Got my answer after debugging. Found out the error . Anyway Thanks !