Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Jira Legacy
serverSystem JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
maximumIssues20
jqlQuerykey = TISDEV-3011
serverId4c843cd5-e5a9-329d-ae88-66091fcfe3c7

TIS will need to now the previous and future Local Office that a trainee was/will be assigned to.

A query and table data structure are required to enable TIS to lookup this information.


Code Block
sql
sql
select pm.PersonID, p.ManagingDeanery as lo, ProgrammeStartDate sd, pm.ProgrammeEndDateWithPOG ed, 'prg' as rec_type
from [HEELIVE].[vwProgrammeMembership] as pm
join [HEELIVE].[vwProgramme] as p on (p.ProgrammeID = pm.ProgrammeID)
union all
select pl.PersonID, ISNULL(p.ManagingDeaneryLETB, t.DeaneryLETB) as lo, pl.StartDate sd, pl.EndDate ed, 'plc' as rec_type 
from [HEELIVE].[vwPlacement] as pl
join [HEELIVE].[vwPost] as p on (p.PostID = pl.PostID)
left join [HEELIVE].[vwSite] as s on (s.SiteID = p.MainSiteID)
left join [HEELIVE].[vwTrust] as t on (t.TrustID = s.TrustID)
union all
select ps.PersonID, t.DeaneryLETB as lo, cast(null as date) as sd, cast(null as date) as ed, 'asi' as rec_type
FROM [HEELIVE].[vwPersonAssociatedSite] as ps
JOIN [HEELIVE].[vwSite] as s on (s.SiteID = ps.SiteID)
JOIN [HEELIVE].[vwTrust] as t on (t.TrustID = s.TrustID)
GROUP BY ps.PersonID, t.DeaneryLETB
union all
select pt.PersonID, t.DeaneryLETB as lo, cast(null as date) as sd, cast(null as date) as ed, 'atr' as rec_type
FROM [HEELIVE].[vwPersonAssociatedTrust] as pt
JOIN [HEELIVE].[vwTrust] as t on (t.TrustID = pt.TrustID)
GROUP BY pt.PersonID, t.DeaneryLETB
union all
select lo.UniqueID as PersonID, LocalOfficeName as lo, cast(null as date) as sd, cast(null as date) as ed, 'hlo' as rec_type
from [HEELIVE].[vwLocalOffice] as lo
where lo.ItemType = 'Person'
and lo.LocalOfficeName is not null
group by lo.UniqueID, LocalOfficeName

This current current generates the following volume of data

People Local Office History data volumes

rec_typeRow Count
prg246029
plc1402350
asi33292
atr35806
hlo261853

By Person Status

People Local Office History data volumes by Status

statusrec_typeRow Count
Currenthlo73337
Currentasi26839
Currentplc733600
Currentprg134198
Currentatr28996
Inactiveasi6453
Inactiveatr6810
Inactivehlo177553
Inactiveplc668750
Inactiveprg111831


With the following rows returning a NULL LocalOffice value

People Local Office History with Null value

rec_typeRow Count
prg4478
plc57616
asi9475
atr9054

 The following NULL values only have a NULL LocalOffice available, unless the source Intrepid data is cleansed to populate the ManagingDeanery field

People Local Office History with only Null values

rec_typeRow Count
asi3986
atr3909
plc216