How to create one column based on condition in Linq Query

Hi All,

Example:
Input
Empolyee MangerName
John joe
Michael Joe
Kamal vivek

Output:
MangerName Count
Joe 2
Vivek 1

Using Linq Query
@loginerror @Uemoe

@aksh1yadav @badita

Hope this thread could help you buddy

Cheers @sweth

1 Like

@Palaniyappan

Thank for Quick reply …

I read this post I don’t want sum. I wanna to add new column and the value is based on Manger name row count

and result should be in a Data table … :worried:

1 Like

Hey @sweth

To achieve your desired results you have to use groupby.

image

Find attached Sample for your assistance -SwethaSample.xaml (9.8 KB)

Regards…!!
Aksh

3 Likes

@aksh1yadav

Thank you … it working

how to i add select new function to avoid for each? can you help me