Similar to Superset Computing 90th percentile response time, except with a SQL Server data source. SQL Server has a different syntax for its percentile functions where the variable is not specified in the main function call and I can't figure out how to input it as a Superset metric.
I have Type
as a Dimension in my Superset chart. I put AVG([Time])
as a metric, I get that value for each Type
row. Great. Now to do 90th percentile.
For 90th percentile, I try
PERCENTILE_CONT(0.9) WITHIN GROUP (ORDER BY [Time]) OVER (PARTITION BY [Type])
That errors with
"Column 'dbo.vw_Fire_Dashboard.Time' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
I've tried removing the OVER ...
at the end as I did to adapt other metrics to Superset, but then it complains that
'PERCENTILE_CONT' must have an OVER clause.