Hi,
I have the below sql code and want to convert this to alteryx formula and apply to dataset below.
isnull(SUBSTRING(rtrim(ltrim(hhm.Surname)),2,1),'2')
+isnull(SUBSTRING(rtrim(ltrim(hhm.Surname)),3,1),'2')
+isnull(SUBSTRING(rtrim(ltrim(hhm.Surname)),5,1),'2')
+isnull(SUBSTRING(rtrim(ltrim(hhm.forenames)),2,1),'2')
+isnull(SUBSTRING(rtrim(ltrim(hhm.forenames)),3,1),'2')
+case when hhm.[Date of Birth] is NULL
then '00000000'
else replace(CONVERT(char(10),hhm.[Date of Birth],103),'/','')
end
+isnull(case when hhm.Gender = 'M'
then '1'
else '2'
end,'2') as 'Statistical Linkage Key'
Tenant Code | Surname | Forenames | Date of Birth | Gender |
100 | Annetts | Karen | 1981-04-12 | F |
101 | Barood | Sami | 1991-07-06 | M |
Required Field:
Tenant Code | Statistical Linkage Key |
100 | nntar120419812 |
101 | aroam060719911 |
Thanks
Jag