Does anyone know how to write query to get totals of each group and their percentage. Below is the example. Ct is count, Per is percentage, Pri is priority level Thanks a lot!
Region Ct_Tkts Per_Region ct_prior_3 ct_prio_2 Per_Prio_3 Percentage_Priority_2
N.Amer 1000 20% 500 500 10% 10%
S.Amer 1000 20% 1000 300 20% 5%
Asia 500 10%
Europe 5000 50%
This is what i tried, i keep getting errors!!
select REGION,COUNT(*) as TotalCount,
(COUNT(*) * 1.0) / SUM(COUNT(*)) over() as Percent
FROM [Xyz] h
ON p.PARENT_TICKET_ID = h.CASE_ID