How to get Row count from Data table with multiple status (Conditions)

Hello,

I want to get count of rows as per Status updated in Excel file in column.
I have different status in one column and want to get count against that status.

Below is my Excel file data

From this data I want to get 3 counts (1st 2 able to get, challenge is for only 3rd)

  1. Total Number of Lines (Which I am able to Get with Op_Dt.Rows.Count.ToString)

  2. Count with Status -“Printed” (Able to get with Op_Dt.asenumerable.where(function(a) a(“Status”).tostring.startswith(“Printed”)).tolist.count)

  3. Count with Status - “Report not found message” & “Not Printed” (return 0 count if I used multiple condition in above statement)

@nilesh.mahajan

please try this

dt.AsEnumerable.Count(function(x) x("Status").ToString.Equals("Not Printed") OrElse x("Status").ToString.Equals("Report not found Message"))

if values are not exact then try contains instead of equals

cheers

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