cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Repetitive Values in a collection or Excel

vinodchinthakin
Level 9
Hi All,
I have a following scenario where I want to remove duplicate/repetitive values in a column.
In below example, I want to remove complete rows of text Raju which is repeated more than once in Column Name and output should look as shown below.
What logic I can apply other than conventional solution like using a loop. If the Input has 50K records or high number of records where using a loop might not be a perfect solution.
Do we have a any action for that in collection or in Excel VBO or any developed code in VB.net or C#?

Input Collection : 
Name    Age    Location
Raju       23        Mumbai
Ravi       34         Bangalore
Raju       27         Hyderabad
Ramesh 45         Delhi

Output Collection : 
Name    Age    Location
Ravi       34         Bangalore
Ramesh 45         Delhi


------------------------------
vinod chinthakindi
------------------------------
13 REPLIES 13

Hi Dev! I opened a conversation explaining better what i want to do: 
https://community.blueprism.com/question/get-non-repeating-records-from-collection-review-all-columns#688cccba-ac04-40dc-bbac-0186265f7056

I replicated the solution you gave in this chat but I in the Input "Field Name" it only considers only one column to identify repeated records, i want to do the same but to consider all columns form the collection to identify repeated records , with the note that I also want to get as output only the NON repeated records, example of what I'm trying to achieve: 


Input Collection :
 18965.png
Output Collection:

18966.png
Thanks in advance!


------------------------------
Gabriela Esquivel
------------------------------

Hi Devneet,

Im trying to use your solution, i get an error Public member 'Trim' on type 'Decimal'  any idea how to resolve this?

------------------------------
Shuaib Salie
Medscheme
Africa/Johannesburg
------------------------------

Hi @Shuaib Salie,

If possible, can you share any screenshot of the error where I can see at which line it is showing the issue. Also, can you tell me exactly which code you are referring to since there're way too many codes on this thread now lol​

------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

Hi @devneetmohanty07,

Its this one:

Output_Collection = (From row In Input_Collection _
Group row By a = row(Field_Name).Trim.ToString Into grp = Group _
Where grp.Count=1 _
Select grp.ToList).SelectMany(Function(x) x).CopyToDataTable()

I figured out why its happening, the Field_Name is a number type. I tested it using a different column (text) and it worked. Can the code be modified when referencing a number type column. I got the error when executing the action.

------------------------------
Shuaib Salie
RPA Developer
Medscheme
Africa/Johannesburg
------------------------------