Oracle Solution for Error ora-36165

Solution for Oracle Error ORA-36165

ORA-36165: (XSAGGCNTPROP) Variable workspace object

cannot have both an AGGCOUNT and the $COUNTVAR property.

What triggered the Error:

An attempt was made to add the $COUNTVAR property to a variable which already had an AGGCOUNT, or vice versa.

What should we do to fix it:

Delete the already existing $COUNTVAR property or AGGCOUNT first.