Solution:
var groupQuery =
from table in
DT.AsEnumerable()
group table by
new { column1 = table["Parent"] }
into groupedTable
select
new
{
x = groupedTable.Key,
// Each Key contains column1 and column2
y = groupedTable.Count(),
nmdays = groupedTable.Sum(r => r.Field<int>("mandays")),
delayeddays = groupedTable.Sum(r => r.Field<int>("delayeddays")),
mandayconsumed = groupedTable.Sum(r => r.Field<int>("mandayconsumed"))
};
want to perform group by on two columns "Coulmn1" and "Column2".
var groupQuery =
from table in
DT.AsEnumerable()
group table by
new { column1 = table["Parent"] ,column2 = table["Parent1"] }
into groupedTable
select
new
{
x = groupedTable.Key,
// Each Key contains column1 and column2
y = groupedTable.Count(),
nmdays = groupedTable.Sum(r => r.Field<int>("mandays")),
delayeddays = groupedTable.Sum(r => r.Field<int>("delayeddays")),
mandayconsumed = groupedTable.Sum(r => r.Field<int>("mandayconsumed"))
};
No comments:
Post a Comment