Use aggregation in scripted fields