0

I have a field where I'd like to count the number of instances the field has the max number for that given column. For example, if the max value for a given column is 20, I want to know how many 20's are in that column. I've tried the following formula but I have received a "Cannot mix aggregate and non-aggregate arguments with this function."

IF [Field1] = MAX([Field1]) 
THEN 1
ELSE 0
END
Jswojcik
  • 19
  • 4

1 Answers1

1

Try

IF ATTR([Field1]) = MAX(['Field1'])
THEN 1
ELSE 0
END

ATTR() is an aggreation which will allow you to compare aggregate and non aggregate values. As long as the value you are aggregating with ATTR() contains unique values then this won't have an impact on your data.

Alex Dowd
  • 39
  • 9
  • Please don't post only code as answer, but also provide an explanation what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes. – Mark Rotteveel Jul 22 '21 at 07:40