Count of records +/- x% of the average
I need to show the min, average, max rate with a count of records that fall above or below the average rate. I have tried using the following formula but it doesn't work:
count( if( staffing.Person_Job_Current.HourlyPayRate < average( staffing.Person_Job_Current.HourlyPayRate, groupBy( staffing.Person_Job_Current.JobCode ) ), 1, 0 ) )
Any guidance would be helpful.