Currently, there's no way to create a UDAnF that creates a DISTINCT result. The parser won't pass DISTINCT when an aggregate is used as an analytic function.
This ticket is to add a DISTINCT flag to the UDAnF context so that a UDAnF can be created that is always DISTINCT. It's also possible to create a multi-parm aggregate that could use one of the parameters to indicate distinctness.
This ticket does not cover the case of UDAF – the use of a function as an aggregate, not a Window Function.
UDAnF created with this feature should have the UDAF_OVER_REQUIRED flag set in the runflags, as the distinctness would be ignored by aggregate use and would definitely confuse a user.