Commit 71927964 authored by Carl Corder's avatar Carl Corder
Browse files

document data transformations

parent 5f8ed046
# acts-875
# ACTS 475/875: Actuarial Applications in Practice
Lincoln Financial Group: Relationship to Needed by Renewal.
\ No newline at end of file
Lincoln Financial Group: Relationship to Needed by Renewal (2017 - 2022).
# Data
```sql
select distinct
sysdate as val_date,
eligible_lives,
enrolled_lives,
vg.vit_group_seq,
vc.coverage_name,
vc.needed_premium,
vc.final_quoted_premium,
vr.event_type,
vr.rae_eff_date,
CASE
WHEN
vr.renewal_instance = 'ARCLOUD'
or vr.renewal_instance = 'CANNANO'
or vr.renewal_instance = 'CONFORTAI2'
or vr.renewal_instance = 'GSOO'
or vr.renewal_instance = 'PEPPERJAM'
or vr.renewal_instance = 'REHOBOTHSC'
or vr.renewal_instance = 'RONYAKOH'
or vr.renewal_instance = 'STANDARDM2'
or vr.renewal_instance = 'VAULTSTRUC'
Then
NULL
ELSE
vr.renewal_instance
END
AS renewal_instance , vc.cov_eff_date , vc.avg_salary_num , vr.sales_office,
vr.uw_region , vg.industry_code , vg.situs_state
from
gp_rating.vit_group@gmandb vg, gp_rating.vit_rae@gmandb vr,
gp_rating.vit_offering@gmandb vo, gp_rating.vit_coverage@gmandb vc
Where
vg.vit_group_seq = vr.vit_group_seq
and vr.vit_rae_seq = vo.vit_rae_seq
and vo.vit_offering_seq = vc.vit_offering_seq
and vo.curr_offering = 'Y'
and vo.sold_ind = 'Y'
and (vc.INCLUDED_IN_WCP = 'Y' or vc.INCLUDED_IN_WCP is null)
```
### Transformations
0. Start with 32,388 rows of data
1. Delete `VAL_DATE` column
2. Delete `RAE_EFF_DATE` column
3. Delete rows with `EVENT_TYPE` = 'NBOC' or 'Amendment'
4. Move `VIT_GROUP_SEQ` column to left
5. Delete rows with `EVENT_TYPE` = 'New Business' and `RENEWAL_INSTANCE` = '1st Renewal'
6. Set `RENEWAL_INSTANCE` = 0 if `EVENT_TYPE` = 'New Business' and `RENEWAL_INSTANCE` is blank
7. Map `RENEWAL_INSTANCE`
```js
{'1st Renewal' -> 1, '2nd Renewal' -> 2, '2nd +' -> 2, '3rd Renewal +' -> 3}
```
8. Remove hh:mm:ss from `COV_EFF_DATE` timestamp.
9. Keep `COV_EFF_DATE` with dates in 2017 - 2020 range
10. Map `UW_REGION`
```js
{'EAST' -> {Atlanta, Boston, Charlotte, Long Island, Nashville, New Jersey, New York,
Parsnippany, Philadelphia, Portland ME, Rochester, Washington D.C., White Plains},
'CENTRAL' -> {Chicago, Cincinnati, Cleveland, Detroit, Ft Lauderdale, Indianapolis*, Miami*,
Milwaukee, Minneapolis, Omaha, Orlando, Pittsburgh, St. Louis, Tampa},
'WEST' -> {Dallas, Denver, Houston, Kansas City*, Los Angeles, Orange County, Phoenix,
Portland OR*, Sacramento, San Diego, San Francisco, Seattle},
'HOME' -> {Home}}
```
11. Join SIC data to get industry information
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment