How to get count values in a column from another Datatable in Linq Query? Please Help

Please help me to solve this.
I need to get the count values (“Y”) in “Col 2” in Datatable 2 for each values in Column 2 in Datatable 1.

What I have:
Datatable 1:
image
Datatable 2:
image

What I need:
In a New Datatable:
image

Since dealing with datatable with large data, I am trying in LinQ Query instead of For Each loop:

Please help me

@GuhanTM Check this Workflow :

I think we can achieve the needed output by applying a Left Join Operation first and then use a Group By and Count Linq query to get the required Output provided the result datatable is already built.

GroupByCount.zip (8.4 KB)

2 Likes

Thank you @supermanPunch. Its working as I expected.
Again, thanks a lot.

1 Like

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