Below is a sample of the syntax on how to sum values together
var qs = axapta.CustTrans.Where(g => g.TransType == LedgerTransType.Cust
&& g.Invoice != "").Select(g => g.AmountCur).Sum();
Below is a sample of the syntax on how to count transactions
var qs = axapta.CustTrans.Where(g => g.TransType == LedgerTransType.Cust)
.Select(g => g.AmountCur).Count();
Below is a sample on the syntax on how to get averages
var qs = axapta.CustTrans.Where(g => g.TransType == LedgerTransType.Cust)
.Select(g => g.AmountCur).Average();