If i understand you well...
On the first look, you have to group data only by
Idendity Name
and make some changes in your query code:
var query3 = (from a in t_eight.AsEnumerable()
group a by new
{
IdendityName = a.Field<string>("Idendity Name"),
ContactPersonName = a.Field<string>("Contact Person Name"),
CustomerName = a.Field<string>("Customer Name")
}
into g
select new
{
IdendinyName = g.Key.IdendityName,
ContactPersonName = g.Key.ContactPersonName,
CurtomerName = g.Key.CustomerName,
TotalBook = g.Sum(x => x.Field<int32>("Total Book Quantity"))
+ g.Sum(y => y.Field<int32>("Quatan Book Qty"))
- g.Sum(z => z.Field<int32>("Return Book Quality"))
}
).ToList();
Let me know, if it's helpful...