How find combined count rows and columns in datatable?

how find combined count rows and columns in datatable?


above mentioned our datatable i need combined out put for month and unit column below mentioned our template datatable i have already creat it table

kindly share work flow…

Hello @domsmgtmeet22

You could perhaps use the “Select” parameter on the datatable to grab the requested fields.

Datatable.Select("[Unit]='KCH' And [Month]='May'").CopyToDatatable.Rows.Count

Regards
Soren

i need group count update my template datatable

How to Group by and Count Data in a DataTable and Populate a Template in UiPath?

@domsmgtmeet22

You can use groupby to get count if each geoup

Dt.AsEnumerable.GroupBy(function(x) x("ColumnToGroupOn").ToString).Select(function(x) newdt.LoadDataRow({x.Key,x.Count},False)

Here newdt contains teo columns first the key column with string and second count with int datatypes

This given count for each group which can then be written as you need in the dattable

You can group on multiple columns as well if needed

Cheers