Aggregate function to calculate Standard Box