Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt multi-card inclusion #684

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions dbt/models/model/model.vw_card_res_input.sql
Original file line number Diff line number Diff line change
Expand Up @@ -818,22 +818,20 @@ FROM forward_fill AS f1
LEFT JOIN (
SELECT *
FROM forward_fill
WHERE NOT ind_pin_is_multicard
/* Unfortunately, some res parcels are not unique by pin10, card, and
year. This complicates one of our core assumptions about the res parcel
universe.
See https://github.com/ccao-data/data-architecture/issues/558 for more
information. */
AND SUBSTR(meta_pin, 11, 4) = '0000'
/* Unfortunately, some res parcels are not unique by pin10, card, and
year. This complicates one of our core assumptions about the res parcel
universe.
See https://github.com/ccao-data/data-architecture/issues/558 for more
information. */
WHERE SUBSTR(meta_pin, 11, 4) = '0000'
AND nearest_neighbor_1_dist_ft <= 500
) AS nn1
ON f1.nearest_neighbor_1_pin10 = nn1.meta_pin10
AND f1.meta_year = nn1.meta_year
LEFT JOIN (
SELECT *
FROM forward_fill
WHERE NOT ind_pin_is_multicard
AND SUBSTR(meta_pin, 11, 4) = '0000'
WHERE SUBSTR(meta_pin, 11, 4) = '0000'
AND nearest_neighbor_2_dist_ft <= 500
) AS nn2
ON f1.nearest_neighbor_1_pin10 = nn2.meta_pin10
Expand Down
Loading