If you want to total some records you have to scope the required records and write to destination:
*XDIM_MEMBERSET XXX=...
...
*WHEN YYY
*IS *
*REC(EXPRESSION=%VALUE%, ACCOUNT=TotalRev)
*ENDWHEN
All selected records will be aggregated in TotalRev
Vadim