How to get the all the names and number of count of the names from table

hi i have data in table like

raju
suresh
mahesh
naresh
mahesh
kumar
ramesh
suresh
ramesh

i want the count of each name ilke how many times its repeated

Hey @T_Y_Raju ,

You can try
(From row In dt_original Group row By name = row("Name") Into Group Let grpCount = Group.Count Select dtOutput.Rows.Add({name,grpCount})).CopyToDataTable

Hi @T_Y_Raju ,
You can try
my ouput
image

my input

image

my code
Sequence.xaml (22.4 KB)

my file at sheet 2
TEST.xlsx (12.7 KB)

regards,
LNV

iam getting error

(From row In ExtractDataTable
Group row By name = row(1) Into Group
Let grpCount = Group.Count
Select Dt_output.Rows.Add({name,grpCount})).CopyToDataTable

Get_Countof_Contacts.xaml: BC30456: ‘Rows’ is not a member of ‘String’.

image
Hey @T_Y_Raju i have attached the worflow below which is solved using linq ,Hope it helps you
GroupRowCount.xaml (10.8 KB)
Regards,

first use read range activity
use assign activity
In assign activity create some variable
and value is
Read_DT.AsEnumerable.GroupBy(function(row) row(“Name”).ToString).ToDictionary(Function(g) g.Key,Function(g) g.Count)

hope it helps

Hey @T_Y_Raju, Dt_output is of string. Please update it from the variables panel to system.data.datatable