Farhan Shariff

Farhan Shariff

  • NA
  • 933
  • 241.4k

Finding MAX and MIN based on Grouping in a DataTable

Jun 23 2014 8:54 AM
//Edited
I have a DataTable, I want to Finding MAX and MIN based on Grouping in a DataTable.
Here in group column I want to Retain Max and Min value based on Group and delete rest in the same group
and when group is null just skip that row



Par Name
Group
Min
Max
ADC1
C_A
- 0.2     1
ADC2
C_A
- 2  2
USB1
C_R
 -3  3
USB2
C_R
 -4  2
Value1
 C_A  -5  3
ADC3
C_A
 -2
Value2
   -4  1


Output : 

Par Name
Group
Min
Max

 Value1


 C_A


 -5


 3


 ADC3


 C_A


 -2


 5


 USB2


 C_R


 -4


 2


 USB1


 C_R


 -3


 3


 Value



 -4


 1


Answers (8)