I was attempting to find the 95%ile of the all the values per hour and display them at daily level.
Here is snippet of the code i am working on :
select distinct columnA
,date(COLLECTDATETIME) as date_stamp
,hour(COLLECTDATETIME) as hour_stamp
,PERCENTILE_DISC(0.95) WITHIN GROUP(order by PARAMETER_VALUE)
over (PARTITION BY hour(COLLECTDATETIME)) as max_per_day
from TableA
where
columnA = 'abc'
and PARAMETER_NAME = 'XYZ';
right now the result set gives me the same value per hour each day, but it doesnt the 95%ile value for a given hour per day.
Thanks in advance