7 Replies Latest reply on Nov 16, 2017 6:07 AM by Norbert Maijoor

# Aggregate function is already an aggregation, and cannot be further aggregated

Hi everyone,

Extend the discussion Re: Grand Total Does NOT Update With Parameter Top Filter (thank you Jonathan Drummey for the help on that one) with a new challenge.

I can't figure this one out, and I really would appreciate any hint or suggestion.

Attached my package workbook sample.

I'm trying to use a calculation from this previous discussion to create a column that would give the group range where the total belongs.

I attempted to create a column where:

BIN1 >> TOTAL = 0 ~ 400

BIN2 >> TOTAL = 400 ~ 600

BIN3 >> TOTAL = 600~1000

Ideally,

IF { FIXED [Master ID]: SUM([Amount in Top N]) } >= 0 AND

{ FIXED [Master ID]: SUM([Amount in Top N]) } <= 400

THEN 'BIN 1'

ELSEIF { FIXED[Master ID]: SUM([Amount in Top N]) } > 400 AND

{ FIXED [Master ID]: SUM([Amount in Top N]) } <= 600

THEN 'BIN 2'

ELSEIF { FIXED [Master ID]: SUM([Amount in Top N]) } > 600 AND

{ FIXED [Master ID]: SUM([Amount in Top N]) } <= 1000

THEN 'BIN 3'

END

but getting an error message below:

(Aggregate function is already an aggregation, and cannot be further aggregated) When I went straight to the Amount, the result was incorrect

IF { FIXED [Master ID]: SUM([Amount]) } >= 0 AND

{ FIXED [Master ID]: SUM([Amount]) } <= 400

THEN 'BIN 1'

ELSEIF { FIXED[Master ID]: SUM([Amount]) } > 400 AND

{ FIXED [Master ID]: SUM([Amount]) } <= 600

THEN 'BIN 2'

ELSEIF { FIXED [Master ID]: SUM([Amount]) } > 600 AND

{ FIXED [Master ID]: SUM([Amount]) } <= 1000

THEN 'BIN 3'

END

correct result should be 'BIN 2' Any suggestion?

THANK YOU