ORA-18660
FILTER clause on aggregate function must use NULL ON NULL clause
Cause
The specified aggregate function must have the NULL ON NULL clause in order to support the FILTER clause.
Action
Specify the NULL ON NULL clause for this aggregate function, or remove the FILTER clause and write an equivalent query using WHERE.