A lot of the linked to posts in the above are old and some (but not all) things have changed.
Generally speaking, Operations Dashboard supports whatever service layers advertise they support (or at least, we try to). Behind the scenes, the service layer's REST endpoint will contain metadata that tells us what we can do with the service. Look for JSON something like the following (I've highlighted some of the ones that are looked at)
"supportsAdvancedQueries": true,
"supportedQueryFormats": "JSON, AMF, geoJSON",
"ownershipBasedAccessControlForFeatures": {"allowOthersToQuery": true},
"useStandardizedQueries": true,
"advancedQueryCapabilities": {
"useStandardizedQueries": true,
"supportsStatistics": true,
"supportsHavingClause": true,
"supportsOrderBy": true,
"supportsDistinct": true,
"supportsPagination": true,
"supportsTrueCurve": true,
"supportsReturningQueryExtent": true,
"supportsQueryWithDistance": true,
"supportsSqlExpression": true
},
Tip: Operations Dashboard likes useStandardizedQueries=true. This is a setting on your Server/Portal.
If useStandardizedQueries=true and you have a service layer that advertises it supports something but are still having problems, we'd have to look deeper for an explanation. It could be a bug in Operations Dashboard, in the service implementation, or maybe even in the database.
In the meantime, a workaround **might** be to sling the summary statistic queries in the query layer definition itself. In Operations Dashboard, you can then create your visualizations using the 'Features' option rather than the 'Grouped Values' option. For example, the following query (SQL Server) creates a query layer for crime counts in the last 24 hours, broken down by crime type.
SELECT COUNT(*) AS incident_count, ucr_type from CrimeDB.dbo.incidents
WHERE DISPATCH_DATE_TIME >= DATEADD(hour,-24, GETUTCDATE()) and DISPATCH_DATE_TIME <= GETUTCDATE()
GROUP BY ucr_type
(Note: To create query layers like this, I believe you'd need Pro as ArcMap might not be up to the task).