DCSum is just the name of the variable which is summing up your distinct count.
If your distinct count field is called 'Distinct Count of X', grouped by Y then replace the variable assignment line to read:
DCSum := DCSum + DistinctCount ({X},{Y});
Naith