If you want to use aggregation in a calculated dimension, you will need to wrap it in an aggr() function--remember, that at the dimension level, QlikView does not yet know what dimension it should be aggregating across, so requires an explicit aggr() definition.