Retrieve duplicated values from excel rows

Hi,

I’m currently trying to filter out (not remove) duplicated values of the excel sheet.
How can I assign a datatable to retrieve the duplicated values?

E.g. Excel Sheet 1 (Input)
Fruit|Count
Apple|5
Orange|6
Pear|7
Watermelon|10
Strawberry|5
Mango|8

Excel Sheet 2 (Output)
Fruit|Count
Apple|5
Strawberry|5

In this case the duplicated value is 5, so I’d like to retrieve those that contains ‘5’.

Thank you!

Can you elaborate on your query?

You just want the output must be for common values having same count ?

So long as the values are reoccurring, I want to retrieve them.

So for example if 5 appears 2 times, and 4 appears 2 times as well, I want the output to be two of the 5, and two of the 4.

I’ll suggest the following:

  1. Create a for loop for the original DT
  2. Store the Count in a list
  3. If for the next element the match is found, store it in a new DT
    Else store the new Count in the List
  4. Ouput the DT

Do let me know in case of issue

Mark the answer as solution if it solved your query :smiley:

Cheers :beers:
Thanks,
Shubham

1 Like

@wootberries24
have a look on this demo xaml below showcasing some cases yours included:
FindDupsUniquesFirstFromGroup_By1Col.xaml (8.0 KB)

just update the column info to your scenario by changing:
Group d By k=d(YourColNameOrIndex).toString.Trim Into grp=Group

3 Likes

Fruit_And_Count.xaml (14.3 KB) test.xlsx (8.3 KB)
I think that may be suitable for you and you can use flowchart may be better.

Hi thank you for your reply!

Apparently I have thousands of data so it’s tedious to hard code the certain count values, not just 5 or 6. But thank you for your input!

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