I'm sorry but I'm not getting the result in the suggested code.
If I would use the sum function Sum(fld, condFld, cond), it would be something like;
Sum(mydata, mygroupfield, "mygroupfield = x") - Sum(mydata, mygroupfield, "mygroupfield = y")
which does not allow me to embed a where clause in...