Getting most occured date in row in DataTable

Hey Everyone,
I am trying to get the logic for a situation
I have a ExtractedDataTable (Getting this from data scarping). By using Filter data table I am just keeping Date column which will give me another DataTable full of date which is a string type. Now I want to get the Most occurred date from that filtered DataTable
Is there any way ?

in general it is done with grouping the date values and then counting the group items

can be done with:

  • LINQ
  • iterating over the distinct date values and count for each group the filter result
  • maybe some activities from the Go Marketplace

So I have a row “Date” now I want to compare the Most occurred / most frequency date in that “Date” (Here date is of string format not DateTime)
As I am beginner in UiPath and C#, I don’t know much about LINQ, But I do know about iterations, How can I solve this problem using Iteration method


Let me summarize your case:

  • in a datatable within a column are dates present
  • the date with the highest occurrence count is to find

As mentioned it can be done with group by approaches and then count the groups

For starting learning UiPath and to explore the essentials this task can be simulated with a dictionary

In case this date was never seen in the iteration the count is set to 1. Otherwise we do increment the count by 1.

Find starter Help here
Rajat_16.xaml (11.0 KB)

Hi, Thanks :smiley: Works fine and as expected :slight_smile: but what if two dates has same number of occurrence?

Then there is no single top most and you have to define the requirements on how to handle

Oh okay, Thanks alot :smiley: