update to handle up to 3 dimensional cube so that we call scoreatprecentile with
only upto 2d data.
Correct dim coord behaviour for aggregated by.