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
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
Here’s what I’m intending to do, to separate those into different files/sheets:
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