You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clancyjane edited this page Sep 23, 2014
·
1 revision
This is an example of median los calculated using an entry cohort and calculating the median LOS through the current data warehouse cutoff date for ALL ENTRIES even if they did NOT exit. If they did not exit the cutoff_date is used. This is an EXAMPLE ONLY. You may NOT want to handle children who DID NOT EXIT in this manner.
select distinct
Year(Removal_dt) [Removal Year]
, PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY dur_days) OVER (PARTITION BY Year(Removal_Dt)) [Median - dur_days]
frombase.rptPlacement plc,ref_last_dw_transfer
where Year(Removal_dt) between 2000and (year(cutoff_date)-1)
order by Year(Removal_dt)