|

Find that Charity

Charitable companies

Owned by david, visibility: Public

SQL query
select case when latest_income > 10000000 then '11 over-10m'
		when latest_income > 5000000 then '10 5m-to-10m'
		when latest_income > 1000000 then '09 1m-to-5m'
		when latest_income > 500000 then '08 500k-to-1m'
		when latest_income > 250000 then '07 250k-to-500k'
		when latest_income > 100000 then '06 100k-to-250k'
		when latest_income > 50000 then '05 50k-to-100k'
		when latest_income > 25000 then '04 25k-to-50k'
		when latest_income > 10000 then '03 10k-to-25k'
		when latest_income > 0 then '02 under-10k'
		when latest_income = 0 then '01 zero-income'
		else '00 unknown' end as "Income band",
	sum(case when charity_type = 'Charitable company' then 1 else 0 end) as "Charitable company",
	sum(case when charity_type = 'CIO' then 1 else 0 end) as "CIO",
	sum(case when charity_type = 'Trust' then 1 else 0 end) as "Trust",
	sum(case when charity_type = 'CIO' then 0
        	 when charity_type = 'Charitable company' then 0
        	 when charity_type = 'Trust' then 0
        	 else 1 end) as "Others",
	to_char((sum(case when charity_type = 'Charitable company' then 1 else 0 end) / count(*)::float)*100, 'FM99D9%%') as "Charitable company (proportion)",
	count(*) as total
from charity_ccewcharity cc 
where charity_registration_status = 'Registered'
	and linked_charity_number = 0
group by "Income band"

12 rows

Income band Charitable company CIO Trust Others Charitable company (proportion) total
00 unknown 664 6,085 338 1,022 8.2% 8,109
01 zero-income 1,923 2,708 2,178 6,264 14.7% 13,073
02 under-10k 3,713 6,076 7,724 38,392 6.6% 55,905
03 10k-to-25k 2,345 3,923 3,866 14,868 9.4% 25,002
04 25k-to-50k 2,301 3,135 2,429 7,667 14.8% 15,532
05 50k-to-100k 3,206 3,022 1,888 6,500 21.9% 14,616
06 100k-to-250k 4,968 2,932 1,706 6,571 30.7% 16,177
07 250k-to-500k 3,758 1,170 649 2,010 49.5% 7,587
08 500k-to-1m 3,040 614 382 868 62.% 4,904
09 1m-to-5m 4,116 322 370 627 75.7% 5,435
10 5m-to-10m 909 32 61 110 81.7% 1,112
11 over-10m 1,041 35 62 268 74.% 1,406
Copy and export data

Duration: 194.43ms