-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEthnicity.sql
29 lines (29 loc) · 1.64 KB
/
Ethnicity.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#PRACTICAL - Ethnicity
CASE
WHEN IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Other White'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'White and Asian'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'White and Black African'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'White and Black Caribbean'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Other Mixed'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Other Asian'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Other Black'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Refused'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Other (please specify)'
THEN '0'
WHEN IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'White British'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'White Irish'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'White Jewish Ashkenazi'
THEN '1'
WHEN IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Chinese'
THEN '2'
WHEN IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Indian'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Pakistani'
OR IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Bangladeshi'
THEN '6'
WHEN IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Black African'
THEN '7'
WHEN IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Black Caribbean'
THEN '8'
WHEN IFNULL({Personal\P Ethnicity},'x',{Personal\P Ethnicity}) = 'Unknown'
THEN 'U'
END