Thanks for the replies, I didn't explain clearly what I wanted as the output though, and my aggr function was slightly wrong, it should have also contained month.
I need the median sales per customer for each month, I have tried the TOTAL method but it doesn't consider the missing customers, i.e. in months 1 and 3 only two of the three customers have sales, and the median is computed across only these two.
See the attached example and excel data files (M is month). The second table/file ('Median Aggr with Zeros') gives the output I want but only because I have manually added a row with a sales value of 0 for months in which customers have sales. In that Excel file I have highlighted the points which represent the median in each month.
I'd like to do achieve the result of the second table the same in qlikview but without adding these zeros to the raw data - perhaps via some kind of pivot function or similar?