what you are trying to do is called "nested aggregation" - you are trying to apply one aggregated function on top of another. In Qlik Sense, you have to use the AGGR() function or the TOTAL qualifier in order to nest aggregation functions. For example:
I'm teaching a whole 3-hours lecture on the rules and analytical uses of the AGGR() function at the Masters Summit for Qlik - check out our agenda and see if our advanced training is for you. We will be in Washington, DC and in Amsterdam, Netherlands this fall.