Can anyone help me to solve this?I want all the process name count once and their success and failed count,i.e Count of total Process their success state Count and their failed state Count?

Question:

Otput Should be:

@Anjali_Rani
welcome to the forum

Read/write Excel can be done with Excel Application Scope and read range / write range

The core flow for the report could look like this:

Setup Report Data Structure:
grafik

LINQ Statement:

(From d In dtInput.AsEnumerable
Group d By k=d("Process name").toString.Trim Into grp=Group
Let s = grp.Where(Function (sr) sr("Status").toString.Trim.ToUpper.Equals("PASSED")).Count
Let f = grp.Where(Function (fr) fr("Status").toString.Trim.ToUpper.Equals("FAILED")).Count
Let ra = New Object(){k, grp.Count,s,f}
Select dtReport.Rows.Add(ra)).CopyToDatatable
1 Like

@ppr Thank you very very much. Can you explain the solution please??

@Anjali_Rani
about LINQ have a look here:

About the statement

Line1 - From… iterate over all rows, reference the current looped row by d
Line2 - Group - group the datarows by the value of Process name col - reference the group by grp
Line3 - memorize the count of all Passed within the group
Line4 - as Line3 for Failed
Line5 - construct the Object Array to prepare the add datarow
Line6 - add ra to the report datatable

3 Likes

Thankyou.

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