How to count row in specific column (Column C)?

How to count row in a specific column (Column B) ?

image

Please me about it.

1 Like

Use Read Range to get the Column in a DataTable and then find the number of rows in “DataTable.rows.count”:

Hi @fairymemay

What I understand from your question is that you are trying to count the number of rows in “Invoice” column.

If my understanding is correct then you can use below query to get the rows count

dt.AsEnumerable.Where(Function(row) Convert.ToString(row(“Invoice”)) <>“”).CopyToDataTable.Rows.Count.ToString

Attaching sample workflow file Sample2.xaml (7.2 KB)

Hope that this will work for you :slight_smile:

4 Likes

you can use filter data table activity with keep column name as the property and later you can you datatable.rows.count to get the number of rows of that column

Use this below code @fairymemay
TestDt.AsEnumerable().Select(Function(x) x.Field(Of String)(“YourColumnName”).Trim).ToArray().Where(Function(y) Not String.IsNullOrEmpty(y)).ToArray().Count

Hope this may help you :slight_smile:

1 Like

dt.AsEnumerable.Count(Function (row) not String.IsNullOrEmpty(row("Invoice").ToString))

3 Likes

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