For privacy reasons, we restrict which SQL functions you can use in Ads Data Hub. For example, almost all scalar functions are allowed, with some exceptions, and all analytic functions are restricted.
For aggregated analysis queries, we restrict functions that combine data from multiple users. All aggregate and analytic functions are allowed when processing a single user's data. See User-level aggregations for details. For user list queries, aggregate functions are allowed, however analytic functions aren't supported.
See an example of user-level aggregation
Reference: Allowed functions