I love using SQL views to summarize my data for use in Dashboards and Experience Builder. However, I keep running into the problem of not having a unique identifier for Pro to use. Here's an example query:
SELECT CONTENT_AREA, COUNT(CONTENT_AREA) AS Count
FROM SDE.Dataset
GROUP BY CONTENT_AREA
That gives me a nice table that looks like this:
| CONTENT_AREA | Count |
| Metric1 | 99 |
| Metric2 | 2 |
| Metric3 | 73 |
This query gives me the numbers I need, but Pro can't add it to the map because there is no unique identifier. In other queries that don't use the GROUP BY clause, I can use this trick:
CAST(ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS INT) AS OBJECTID
... but this doesn't work in Pro unless I include OBJECTID in the GROUP BY clause.