if the formula is calculating something that is not in the raw the data (ie, it is not summing up a field, but is say adding a field conditionally) then you cannot use the built in aggregate functions.
you could track the value yourself by adding something like this to the @ep:
shared numbervar rtTotal;
local numbervar thisTotal;
if ..... then .....
thisTotal := original value of @eps
rtTotal := rtTotal + thisTotal;
thisTotal // CR always prints the last value it is given
then when you want to display the total, you would create a formula like:
shared numbervar rtTotal;
rtTotal
and if the value should ever by reset, then where you want the total to reset you would have something like:
shared numbervar rtTotal := 0;
"" //hides the reset from displaying