Excel Remove Duplicates function VS Conventional Programming to Get Unique Numbers? Which is better?


#1

Hi RPA Enthusiasts,

I’ve got this dilemma of which approach to use: Excel Remove Duplicates VS my own conventional “get unique value” function using ‘for each-if unique’ approach. I wanted to get your opinions (or even violent reactions are welcome!) on this one.

First I’ll start with Excel Remove Duplicates
Pros: Faster and saves lines of activities
Cons: You use excel manipulation activities such as ‘Click’ and stuff; and you get to see Excel move on the screen

for my conventional programming approach
Pros: You get to use the computer while the RPA does the job of getting those unique values
Cons: Much slower since I print the unique values cell-by-cell (since it’s dependent on the row number incrementing when printing each line)

Would like to know your thoughts on this, would love to look at different angles :slight_smile:

Thanks!


#2

Hi @TheCProject

Maybe this topic helps?


#3

HI @loginerror - thanks man for responding. However, I checked it though and found out this would be useful for other purposes.

What I’m after is to just isolate those unique values into a separate list (just like what a normal remove duplicates function would do), and use that list as a identifiers to get rows contaning that “unique” value in a specific column. I’m talking about thousands of rows of different “transactions”. Couldn’t post the data though, but I hope you get the point :slight_smile:

Here’s what I’m intending to do, to separate those into different files/sheets:

image


#4

Its work for GroupBy.
Assign Tuple(Of String, Datatable) Terminals = Dt.AsEnumerable.Cast(Of Datarow).
GroupBy(Function(x) New With {
Key .Code = Convert.ToString(r(“Terminal”))}).
Select(Function(g) Tuple.Create(g.Key.Code, g.CopyToDatatable()))

Pseudo Code
Open Excel Application Scope (some excel file)

For Each Tuple(Of String, Datatable) terminal in terminals
Excel.WriteRange (SheetName: terminal.Item1, Datatable: terminal.Item2)
Next

You got your different terminals in different excel sheets


#5

Hi @Uemoe - Thanks. I would highly assume that this would work. Though, not really familiar with Tuples in UiPath yet. Can you provide some examples?


#6

Google dotnet tuple. It’s dotnet type for creating record type with different base types.

If you give me example of your table in excel I can create working workflow for you.


#7

Hi @Uemoe - UPDATE: I got it :smiley:


#8

Working solution on mockup dataExcelSplitSheet.zip (16.2 KB)