EQA1581E Aggregates are not allowed in conditional expressions such as the expressions in IF ... THEN, WHILE ( ... ), UNTIL ( ... ), and WHEN ( ... ) clauses.
Explanation
This is not supported.
Programmer response
Check to see if the variable name was misspelled. If this was not the problem, you must find other logic to perform the task.