Skip to content

Commit

Permalink
Add line 9 ptax info to default.vw_pin_sale_combined (#701)
Browse files Browse the repository at this point in the history
* Add ptax line 9 cols

* Fix table ref

* Add missing column docs

* Remove redundant coalesce

* Make more concise
  • Loading branch information
wagnerlmichael authored Jan 8, 2025
1 parent 6a527bb commit e9adbab
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
32 changes: 32 additions & 0 deletions dbt/models/default/default.vw_pin_sale_combined.sql
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,22 @@ mydec_sales AS (
COALESCE(line_2_total_parcels > 1, FALSE) AS is_multisale,
COALESCE(line_7_property_advertised = 1, FALSE)
AS mydec_property_advertised,
COALESCE(line_9_no_changes = 1, FALSE)
AS mydec_line_9_no_changes,
COALESCE(line_9_demolitiondamage = 1, FALSE)
AS mydec_line_9_demolition_damage,
COALESCE(line_9_additions = 1, FALSE)
AS mydec_line_9_additions,
COALESCE(line_9_major_remodeling = 1, FALSE)
AS mydec_line_9_major_remodeling,
COALESCE(line_9_new_construction = 1, FALSE)
AS mydec_line_9_new_construction,
COALESCE(line_9_other_change = 1, FALSE)
AS mydec_line_9_other_change,
line_9_other_change_description
AS mydec_line_9_other_change_description,
line_9_date_of_significant_change
AS mydec_line_9_date_of_significant_change,
COALESCE(line_10a = 1, FALSE)
AS mydec_is_installment_contract_fulfilled,
COALESCE(line_10b = 1, FALSE) --noqa
Expand Down Expand Up @@ -328,6 +344,14 @@ combined_sales AS (
md_sales.mydec_deed_type,
md_sales.sale_filter_ptax_flag,
md_sales.mydec_property_advertised,
md_sales.mydec_line_9_no_changes,
md_sales.mydec_line_9_demolition_damage,
md_sales.mydec_line_9_additions,
md_sales.mydec_line_9_major_remodeling,
md_sales.mydec_line_9_new_construction,
md_sales.mydec_line_9_other_change,
md_sales.mydec_line_9_other_change_description,
md_sales.mydec_line_9_date_of_significant_change,
md_sales.mydec_is_installment_contract_fulfilled,
md_sales.mydec_is_sale_between_related_individuals_or_corporate_affiliates, --noqa
md_sales.mydec_is_transfer_of_less_than_100_percent_interest,
Expand Down Expand Up @@ -430,6 +454,14 @@ SELECT
afs.mydec_deed_type,
afs.sale_filter_ptax_flag,
afs.mydec_property_advertised,
afs.mydec_line_9_no_changes,
afs.mydec_line_9_demolition_damage,
afs.mydec_line_9_additions,
afs.mydec_line_9_major_remodeling,
afs.mydec_line_9_new_construction,
afs.mydec_line_9_other_change,
afs.mydec_line_9_other_change_description,
afs.mydec_line_9_date_of_significant_change,
afs.mydec_is_installment_contract_fulfilled,
afs.mydec_is_sale_between_related_individuals_or_corporate_affiliates, --noqa
afs.mydec_is_transfer_of_less_than_100_percent_interest,
Expand Down
19 changes: 19 additions & 0 deletions dbt/models/default/schema/default.vw_pin_sale_combined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ models:
description: Indicator for whether or not the observation uses the MyDec sale date
- name: mydec_deed_type
description: Deed type from MyDec, more granular than CCAO deed type
- name: mydec_line_9_additions
description: Binary indicator on the ptax-203 form. A subsection of a question about significant physical changes to the property.
- name: mydec_line_9_date_of_significant_change
description: The date of the change to the property.
- name: mydec_line_9_demolition_damage
description: Binary indicator on the ptax-203 form. A subsection of a question about significant physical changes to the property.
- name: mydec_line_9_major_remodeling
description: Binary indicator on the ptax-203 form. A subsection of a question about significant physical changes to the property.
- name: mydec_line_9_new_construction
description: Binary indicator on the ptax-203 form. A subsection of a question about significant physical changes to the property.
- name: mydec_line_9_no_changes
description: >
Binary indicator on the ptax-203 form. Indicates "no changes to the property" when coded as 1. A value of 0 may indicate either
the presence of changes (subcategories coded as 1) or an unclear status, as many cases have no subcategories coded as 1 despite
this being 0.
- name: mydec_line_9_other_change
description: Binary indicator on the ptax-203 form. A subsection of a question about significant physical changes to the property.
- name: mydec_line_9_other_description
description: This field describes the work done from mydec_line_9_other_change.
- name: nbhd
description: '{{ doc("shared_column_nbhd_code") }}'
- name: num_parcels_sale
Expand Down

0 comments on commit e9adbab

Please sign in to comment.