From 98640b8c0e7ddfc3ebe8053937ccc6a7dbe82865 Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Wed, 9 Oct 2024 19:25:40 +0000 Subject: [PATCH 01/12] Initial commit --- dbt/models/default/default.vw_pin_appeal.sql | 126 +++++++++++-------- dbt/seeds/ccao/ccao.htpar_reascd.csv | 100 +++++++++++++++ dbt/seeds/ccao/docs.md | 9 ++ dbt/seeds/ccao/schema.yml | 8 ++ 4 files changed, 189 insertions(+), 54 deletions(-) create mode 100644 dbt/seeds/ccao/ccao.htpar_reascd.csv diff --git a/dbt/models/default/default.vw_pin_appeal.sql b/dbt/models/default/default.vw_pin_appeal.sql index 9899df0a0..67f210744 100644 --- a/dbt/models/default/default.vw_pin_appeal.sql +++ b/dbt/models/default/default.vw_pin_appeal.sql @@ -1,89 +1,107 @@ -- View containing appeals by PIN +WITH reasons AS ( + SELECT + htpar.*, + -- Reason codes come from different columns before and after 2020 + CASE + WHEN htpar.taxyr <= '2020' + AND TRIM(SUBSTR(htpar.user42, 1, 2)) NOT IN ('0', ':') + THEN TRIM(SUBSTR(htpar.user42, 1, 2)) + WHEN htpar.taxyr > '2020' THEN htpar.user89 + END AS reason_code1, + CASE + WHEN htpar.taxyr <= '2020' + AND TRIM(SUBSTR(htpar.user43, 1, 2)) NOT IN ('0', ':') + THEN TRIM(SUBSTR(htpar.user42, 1, 2)) + WHEN htpar.taxyr > '2020' THEN htpar.user100 + END AS reason_code2, + CASE + WHEN htpar.taxyr <= '2020' + AND TRIM(SUBSTR(htpar.user44, 1, 2)) NOT IN ('0', ':') + THEN TRIM(SUBSTR(htpar.user42, 1, 2)) + WHEN htpar.taxyr > '2020' THEN htpar.user101 + END AS reason_code3 + FROM {{ source('iasworld', 'htpar') }} AS htpar +) + SELECT - htpar.parid AS pin, + reasons.parid AS pin, REGEXP_REPLACE(pardat.class, '[^[:alnum:]]', '') AS class, legdat.user1 AS township_code, - htpar.taxyr AS year, + reasons.taxyr AS year, vwpv.mailed_bldg, vwpv.mailed_land, vwpv.mailed_tot, vwpv.certified_bldg, vwpv.certified_land, vwpv.certified_tot, - htpar.caseno AS case_no, + reasons.caseno AS case_no, CASE - WHEN htpar.user38 = 'CC' + WHEN reasons.user38 = 'CC' OR ( - htpar.user38 IN ('RS', 'IC') + reasons.user38 IN ('RS', 'IC') AND REGEXP_REPLACE(pardat.class, '[^[:alnum:]]', '') IN ( '213', '297', '299', '399', '599' ) ) THEN 'condo/coop' - WHEN htpar.user38 = 'CE' THEN 'c of e - exempt' - WHEN htpar.user38 = 'CI' THEN 'c of e - incentive' - WHEN htpar.user38 = 'CO' THEN 'c of e - omitted' - WHEN htpar.user38 = 'CV' THEN 'c of e - valuations' - WHEN htpar.user38 = 'IC' THEN 'commercial' - WHEN htpar.user38 = 'IN' THEN 'incentive' - WHEN htpar.user38 = 'LD' THEN 'land' - WHEN htpar.user38 = 'OM' THEN 'omitted assessment' - WHEN htpar.user38 = 'RS' THEN 'residential' + WHEN reasons.user38 = 'CE' THEN 'c of e - exempt' + WHEN reasons.user38 = 'CI' THEN 'c of e - incentive' + WHEN reasons.user38 = 'CO' THEN 'c of e - omitted' + WHEN reasons.user38 = 'CV' THEN 'c of e - valuations' + WHEN reasons.user38 = 'IC' THEN 'commercial' + WHEN reasons.user38 = 'IN' THEN 'incentive' + WHEN reasons.user38 = 'LD' THEN 'land' + WHEN reasons.user38 = 'OM' THEN 'omitted assessment' + WHEN reasons.user38 = 'RS' THEN 'residential' END AS appeal_type, - -- Status, reason codes, and agent name come from different columns - -- before and after 2020 + -- Status and agent name come from different columns before and after 2020 CASE - WHEN htpar.taxyr <= '2020' AND htpar.resact = 'C' THEN 'change' - WHEN htpar.taxyr <= '2020' AND htpar.resact = 'NC' THEN 'no change' + WHEN reasons.taxyr <= '2020' AND reasons.resact = 'C' THEN 'change' + WHEN reasons.taxyr <= '2020' AND reasons.resact = 'NC' THEN 'no change' WHEN - htpar.taxyr > '2020' AND TRIM(LOWER(htpar.user104)) = 'decrease' + reasons.taxyr > '2020' AND TRIM(LOWER(reasons.user104)) = 'decrease' THEN 'change' - WHEN htpar.taxyr > '2020' THEN TRIM(LOWER(htpar.user104)) + WHEN reasons.taxyr > '2020' THEN TRIM(LOWER(reasons.user104)) END AS change, - CASE - WHEN htpar.taxyr <= '2020' - AND TRIM(SUBSTR(htpar.user42, 1, 2)) NOT IN ('0', ':') - THEN TRIM(SUBSTR(htpar.user42, 1, 2)) - WHEN htpar.taxyr > '2020' THEN htpar.user89 - END AS reason_code1, - CASE - WHEN htpar.taxyr <= '2020' - AND TRIM(SUBSTR(htpar.user43, 1, 2)) NOT IN ('0', ':') - THEN TRIM(SUBSTR(htpar.user42, 1, 2)) - WHEN htpar.taxyr > '2020' THEN htpar.user100 - END AS reason_code2, - CASE - WHEN htpar.taxyr <= '2020' - AND TRIM(SUBSTR(htpar.user44, 1, 2)) NOT IN ('0', ':') - THEN TRIM(SUBSTR(htpar.user42, 1, 2)) - WHEN htpar.taxyr > '2020' THEN htpar.user101 - END AS reason_code3, - htpar.cpatty AS agent_code, + reasons.reason_code1, + reascd1.description AS reason1, + reasons.reason_code2, + reascd2.description AS reason2, + reasons.reason_code3, + reascd3.description AS reason3, + reasons.cpatty AS agent_code, htagnt.name1 AS agent_name, CASE - WHEN htpar.hrstatus = 'C' THEN 'closed' - WHEN htpar.hrstatus = 'O' THEN 'open' - WHEN htpar.hrstatus = 'P' THEN 'pending' - WHEN htpar.hrstatus = 'X' THEN 'closed pending c of e' + WHEN reasons.hrstatus = 'C' THEN 'closed' + WHEN reasons.hrstatus = 'O' THEN 'open' + WHEN reasons.hrstatus = 'P' THEN 'pending' + WHEN reasons.hrstatus = 'X' THEN 'closed pending c of e' END AS status -FROM {{ source('iasworld', 'htpar') }} AS htpar +FROM reasons LEFT JOIN {{ source('iasworld', 'pardat') }} AS pardat - ON htpar.parid = pardat.parid - AND htpar.taxyr = pardat.taxyr + ON reasons.parid = pardat.parid + AND reasons.taxyr = pardat.taxyr AND pardat.cur = 'Y' AND pardat.deactivat IS NULL LEFT JOIN {{ source('iasworld', 'legdat') }} AS legdat - ON htpar.parid = legdat.parid - AND htpar.taxyr = legdat.taxyr + ON reasons.parid = legdat.parid + AND reasons.taxyr = legdat.taxyr AND legdat.cur = 'Y' AND legdat.deactivat IS NULL LEFT JOIN {{ ref('default.vw_pin_value') }} AS vwpv - ON htpar.parid = vwpv.pin - AND htpar.taxyr = vwpv.year + ON reasons.parid = vwpv.pin + AND reasons.taxyr = vwpv.year LEFT JOIN {{ source('iasworld', 'htagnt') }} AS htagnt - ON htpar.cpatty = htagnt.agent + ON reasons.cpatty = htagnt.agent AND htagnt.cur = 'Y' AND htagnt.deactivat IS NULL -WHERE htpar.cur = 'Y' - AND htpar.caseno IS NOT NULL - AND htpar.deactivat IS NULL +LEFT JOIN {{ source('ccao', 'htpar_reascd') }} AS reascd1 + ON reasons.reason_code1 = reascd1.reascd +LEFT JOIN {{ source('ccao', 'htpar_reascd') }} AS reascd2 + ON reasons.reason_code2 = reascd2.reascd +LEFT JOIN {{ source('ccao', 'htpar_reascd') }} AS reascd3 + ON reasons.reason_code3 = reascd3.reascd +WHERE reasons.cur = 'Y' + AND reasons.caseno IS NOT NULL + AND reasons.deactivat IS NULL diff --git a/dbt/seeds/ccao/ccao.htpar_reascd.csv b/dbt/seeds/ccao/ccao.htpar_reascd.csv new file mode 100644 index 000000000..390ddc5c7 --- /dev/null +++ b/dbt/seeds/ccao/ccao.htpar_reascd.csv @@ -0,0 +1,100 @@ +reascd,outcome,description +1,Change,This is the result of an analysis of comparable properties. +10,Change,"This is the result of a development incentive grant including an income, market or cost analysis." +11,Change,"This is the result of an income, market or cost analysis." +12,Change,This is the result of a change in classification. +13,Change,"This is the result of a change in classification including an income, market or cost analysis." +14,Change,This is the result of a change in classification including total or partial occupancy. +15,Change,This is the result of a Property Tax Appeal Board Decision +16,No Change,This is due to your property's uniformity with comparable properties. +17,No Change,This is due to your property's uniformity with comparable properties. The analysis included an update of your property's characteristics. +18,No Change,This is due to lack of data having been submitted for our review. +19,No Change,This is due to insufficient data having been submitted for our review. +1A,Change,This is the result of an equity analysis of comparable properties. +2,Change,This is the result of an analysis of comparable properties. The decrease includes an update of your property's characteristics. +20,No Change,This is due to the absence of or an incomplete Attorney/Representative Authorization form. +21,No Change,"This is due to the sale of the property not having been disclosed or incomplete sale data submitted. (i.e. closing statement, deed.)" +22,No Change,"This is due to income, market or cost analysis supporting the assessment." +23,No Change,This is due to conflict between characteristics provided and our recent field inspection. +24,No Change,This is due to the absence of or an incomplete Property Summary Sheet. +26,No Change,This is due to a development incentive grant. +26A,No Change,This is due to an incentive class being applied. +27,No Change,This is due to an analysis of the sale of the property. +27A,No Change,This is due to an analysis of the actual sale transaction of the property. +28,No Change,This is due to a Board of Review decision or reduction. +28A,Change,This is due to a prior year Board of Review decision or reduction. +29,No Change,This is due to a factual change in your property characteristics and a valuation analysis. +29A,No Change,"This is due to a factual change in your property characteristics, class change was applied and no assessed value reduction is warranted." +2A,Change,"This is the result of an analysis of comparable properties, including an update due to a change in your property characteristics." +3,Change,This is the result of a factual change in your property records. +30,,This is a letter/Unique Property. +31,,This is a letter/Unique Property on Re-review. +32,No Change,"This is due to the absence and/or incompleteness of an income statement, a rent roll, Real Property Income and Expense Form." +33,No Change,This is due to the absence of a vacancy affidavit and/or the lack of documentation required for vacancy relief. +34,No Change,Insufficient or no data was provided to substantiate a field check at the time the appeal was filed. +35,No Change,This is the result of a Property Tax Freeze Program for Historic Residences posted deadlines +35A,No Change,This is the result of a Property Tax Freeze Program for Historic Residences. +36,Change,This result is based on consideration of submitted appraisal and an analysis of comparable properties. +36A,Change,This result is based on consideration of submitted appraisal and an analysis of comparable sales of like properties. +37,Change,"This is the result of an income, market or cost analysis in support of a decrease and in the absence of compliance of Incentive eligibility requirements." +38,Change,This is a result of a market analysis of your property as well as an analysis of comparable properties. +3A,Change,"This is the result of a factual change in your property records, resulting in a reduction in your assessed value." +4,Change,"This is the result of a factual change in your property records including an income, market or cost analysis." +40,No Change,This appeal has been withdrawn due to a petitioner request. +41,No Change,"This appeal has been terminated because the property is exempt. If you have any questions, please contact our Exempt Department at (312) 603-7567." +41A,No Change,This property is currently exempt. +42,No Change,The Assessment reflects a prior valuation analysis. Amendments to the Classification Ordinance (10% & 25%) do not warrant additional relief. +43,No Change,Incentive improvements were not assessed for the current year. +44,No Change,"The Filing Fee, the Municipal Resolution and/or the Living Wage Affidavit were not submitted." +44A,No Change,The documents required to apply the incentive to your property were missing from your submission. +45,No Change,The substantial rehabilitation did not yield any incremental value for incentive action. +45A,No Change,The documents required to apply the affordable housing program reduction to your property were missing from your submission. +46,No Change,The property is railroad operational. +47,No Change,The property is currently partially exempt. +48,No Change,This result is based on consideration of submitted appraisal and an analysis of comparable properties. +48A,No Change,This result is based upon consideration of the appraisal submitted and an analysis of recent comparable property sales. +49,No Change,This is a result of a market analysis of your property as well as an analysis of comparable properties. +4A,Change,"This is the result of a factual change in your property records and an income, market or cost analysis." +5,Change,This is the result of the partial occupancy of your property. +50,No Change,This increase is due to a valuation analysis. +51,No Change,Due to Non-Compliance to the Cook County Board of Commissioners recent amendments to the Tax incentive ordinance. +52,No Change,This is due to conflict between documentation submitted and our recent field inspection. +53,No Change,"The submitted appraisal was not for current year, did not meet acceptable standards, and/or not prepared for the purpose of valuation." +54,No Change,This is due to the failure to abide by the official rules posted by the CCAO. +55,No Change,Flood Damage. +56,No Change,This is due to the removal of the Incentive based on Non-Industrial use or Continuous Substantial Vacancy. +57,No Change,Incentive classification denied due to Non-Industrial use. +58,No Change,This is due to a change in classification but no change in value. +59,No Change,This is due to the Appeal Fee not being submitted. +6,Change,"This is the result of the partial occupancy of your property along with an income, market or cost analysis." +60,No Change,Market Value maintained; increase was due to ramp-up of level of assessment due to non-renewal of Incentive. +61,No Change,Failure to abide by CCAO rule 10� failure to file anonymously. +62,No Change,Failure to abide by CCAO rule 20� missing or incomplete utility bills. +64,No Change,"Failure to abide by CCAO rule 19� missing or incomplete 3 years of income/expense records, RPIE forms, or Schedule E." +65,No Change,Failure to abide by CCAO rule 17� failure to produce all required sales documentation. +66,No Change,Failure to abide by CCAO rule 15� failure to submit a recent original and clear picture of the front of the property (with the exception of Class 2) . +67,No Change,Failure to abide by CCAO rule 21� missing or incomplete evidence of demolition . +68,No Change,"This is the result of a recent field inspection and market, income, and/or comparable market analysis of your property." +69,Change,"This is the result of a recent field inspection and market, income, and/or comparable market analysis of your property." +7,Change,This is the result of the total vacancy of your property. +70,Change,This is a result of the renewal of the Incentive (only). +71,Change,This is a result of the renewal of Incentive and value change. +72,Change,This is a result of the vacancy of your property and the removal of the Incentive due to Continuous Substantial Vacancy. +73,Change,The Property is Railroad Operational. +74,Change,This is a result of a One-Year Only reduction due to vacancy; Incentive not applied due to non-compliance of Incentive requirements. +75,No Change,You have exceeded the number of years of vacancy reduction under our policy and no additional vacancy benefit can be granted. +78,Change,This is the result of a Property Tax Freeze Program for Historic Residences. +79,Change,This is the result of a market and comparable analysis of your multi-improvement property. One (1) or more of your improvements have a decreased assessed value. +79B,No Change,This is the result of a market and comparable analysis of your multi-improvement property. Your case has been reviewed and we concluded a value change was not in order. +8,Change,"This is the result of the total vacancy of your property along with an income, market or cost analysis." +80,Change,This is the result of the total vacancy of your property. Your parcel falls into year two (2) of the CCAO vacancy policy. +81,Change,This is the result of the partial vacancy of your property. Your parcel falls into year two (2) of the CCAO vacancy policy. +82,Change,"This is the result of market and comparable analysis of your property, which includes a home improvement exemption." +83,No Change,"This is the result of market and comparable analysis of your property, which includes a home improvement exemption." +84,No Change,No evidence provided to warrant a field inspection. +85,No Change,Evidence provided contradicts recent field inspection. +88,No Change,Due to Legal Defense Denial. +88,No Change,Due to not submitting an appeal. +9,Change,This is the result of a sale analysis of your property. +90,Change,This is the result of a special reduction reason. +9A,Change,This is the result of a comparable sales analysis of your property. diff --git a/dbt/seeds/ccao/docs.md b/dbt/seeds/ccao/docs.md index 302256102..acbbc935a 100644 --- a/dbt/seeds/ccao/docs.md +++ b/dbt/seeds/ccao/docs.md @@ -35,6 +35,15 @@ To find the level of assessment (LoA) for each class, see the `ccao.loa` table. **Primary Key**: `class_code` {% enddocs %} +# htpar_reascd + +{% docs seed_htpar_reascd %} +Table containing descriptions for reason codes from `iasworld.htpar`. +Reason codes pertian to appeal outcomes. + +**Primary Key**: `reascd` +{% enddocs %} + # loa {% docs seed_loa %} diff --git a/dbt/seeds/ccao/schema.yml b/dbt/seeds/ccao/schema.yml index 6158245b6..7601da920 100644 --- a/dbt/seeds/ccao/schema.yml +++ b/dbt/seeds/ccao/schema.yml @@ -105,3 +105,11 @@ seeds: description: '{{ doc("shared_column_triad_code") }}' - name: year description: '{{ doc("shared_column_year") }}' + + - name: ccao.htpar_reascd + description: '{{ doc("seed_htpar_reascd") }}' + config: + column_types: + reascd: string + outcome: string + description: string \ No newline at end of file From 62241cb1a8f620919815ab33f3201098db757eb5 Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Wed, 9 Oct 2024 19:29:34 +0000 Subject: [PATCH 02/12] Switch from source to ref --- dbt/models/default/default.vw_pin_appeal.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbt/models/default/default.vw_pin_appeal.sql b/dbt/models/default/default.vw_pin_appeal.sql index 67f210744..d2370898f 100644 --- a/dbt/models/default/default.vw_pin_appeal.sql +++ b/dbt/models/default/default.vw_pin_appeal.sql @@ -96,11 +96,11 @@ LEFT JOIN {{ source('iasworld', 'htagnt') }} AS htagnt ON reasons.cpatty = htagnt.agent AND htagnt.cur = 'Y' AND htagnt.deactivat IS NULL -LEFT JOIN {{ source('ccao', 'htpar_reascd') }} AS reascd1 +LEFT JOIN {{ ref('ccao.htpar_reascd') }} AS reascd1 ON reasons.reason_code1 = reascd1.reascd -LEFT JOIN {{ source('ccao', 'htpar_reascd') }} AS reascd2 +LEFT JOIN {{ ref('ccao.htpar_reascd') }} AS reascd2 ON reasons.reason_code2 = reascd2.reascd -LEFT JOIN {{ source('ccao', 'htpar_reascd') }} AS reascd3 +LEFT JOIN {{ ref('ccao.htpar_reascd') }} AS reascd3 ON reasons.reason_code3 = reascd3.reascd WHERE reasons.cur = 'Y' AND reasons.caseno IS NOT NULL From 0dad1f1c01792cec6fea6afe96625f4306444ff3 Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Wed, 9 Oct 2024 19:33:55 +0000 Subject: [PATCH 03/12] Up test failure limit temporarily to let view build --- dbt/models/default/schema/default.vw_pin_appeal.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/dbt/models/default/schema/default.vw_pin_appeal.yml b/dbt/models/default/schema/default.vw_pin_appeal.yml index f19c3f284..1ea76e411 100644 --- a/dbt/models/default/schema/default.vw_pin_appeal.yml +++ b/dbt/models/default/schema/default.vw_pin_appeal.yml @@ -108,6 +108,7 @@ models: - change config: where: CAST(year AS int) BETWEEN {{ var('data_test_iasworld_year_start') }} AND {{ var('data_test_iasworld_year_end') }} + error_if: ">2" - row_count: name: default_vw_pin_appeal_row_count above: 8407667 # as of 2023-11-22 \ No newline at end of file From 1170438cb987d942981bc681e00eea43d31627bb Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Wed, 9 Oct 2024 19:42:19 +0000 Subject: [PATCH 04/12] Remove periods from reason codes in htpar --- dbt/models/default/default.vw_pin_appeal.sql | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/dbt/models/default/default.vw_pin_appeal.sql b/dbt/models/default/default.vw_pin_appeal.sql index d2370898f..196f40754 100644 --- a/dbt/models/default/default.vw_pin_appeal.sql +++ b/dbt/models/default/default.vw_pin_appeal.sql @@ -5,20 +5,26 @@ WITH reasons AS ( -- Reason codes come from different columns before and after 2020 CASE WHEN htpar.taxyr <= '2020' - AND TRIM(SUBSTR(htpar.user42, 1, 2)) NOT IN ('0', ':') - THEN TRIM(SUBSTR(htpar.user42, 1, 2)) + AND REPLACE(TRIM(SUBSTR(htpar.user42, 1, 2)), '.') NOT IN ( + '0', ':' + ) + THEN REPLACE(TRIM(SUBSTR(htpar.user42, 1, 2)), '.') WHEN htpar.taxyr > '2020' THEN htpar.user89 END AS reason_code1, CASE WHEN htpar.taxyr <= '2020' - AND TRIM(SUBSTR(htpar.user43, 1, 2)) NOT IN ('0', ':') - THEN TRIM(SUBSTR(htpar.user42, 1, 2)) + AND REPLACE(TRIM(SUBSTR(htpar.user43, 1, 2)), '.') NOT IN ( + '0', ':' + ) + THEN REPLACE(TRIM(SUBSTR(htpar.user43, 1, 2)), '.') WHEN htpar.taxyr > '2020' THEN htpar.user100 END AS reason_code2, CASE WHEN htpar.taxyr <= '2020' - AND TRIM(SUBSTR(htpar.user44, 1, 2)) NOT IN ('0', ':') - THEN TRIM(SUBSTR(htpar.user42, 1, 2)) + AND REPLACE(TRIM(SUBSTR(htpar.user44, 1, 2)), '.') NOT IN ( + '0', ':' + ) + THEN REPLACE(TRIM(SUBSTR(htpar.user44, 1, 2)), '.') WHEN htpar.taxyr > '2020' THEN htpar.user101 END AS reason_code3 FROM {{ source('iasworld', 'htpar') }} AS htpar From 87db6b216e240485dd8d4731153027d3471d1565 Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Wed, 9 Oct 2024 19:49:46 +0000 Subject: [PATCH 05/12] Remove bad unicode characters from seed --- dbt/seeds/ccao/ccao.htpar_reascd.csv | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dbt/seeds/ccao/ccao.htpar_reascd.csv b/dbt/seeds/ccao/ccao.htpar_reascd.csv index 390ddc5c7..2a8cf7130 100644 --- a/dbt/seeds/ccao/ccao.htpar_reascd.csv +++ b/dbt/seeds/ccao/ccao.htpar_reascd.csv @@ -68,12 +68,12 @@ reascd,outcome,description 59,No Change,This is due to the Appeal Fee not being submitted. 6,Change,"This is the result of the partial occupancy of your property along with an income, market or cost analysis." 60,No Change,Market Value maintained; increase was due to ramp-up of level of assessment due to non-renewal of Incentive. -61,No Change,Failure to abide by CCAO rule 10� failure to file anonymously. -62,No Change,Failure to abide by CCAO rule 20� missing or incomplete utility bills. -64,No Change,"Failure to abide by CCAO rule 19� missing or incomplete 3 years of income/expense records, RPIE forms, or Schedule E." -65,No Change,Failure to abide by CCAO rule 17� failure to produce all required sales documentation. -66,No Change,Failure to abide by CCAO rule 15� failure to submit a recent original and clear picture of the front of the property (with the exception of Class 2) . -67,No Change,Failure to abide by CCAO rule 21� missing or incomplete evidence of demolition . +61,No Change,Failure to abide by CCAO rule 10- failure to file anonymously. +62,No Change,Failure to abide by CCAO rule 20- missing or incomplete utility bills. +64,No Change,"Failure to abide by CCAO rule 19- missing or incomplete 3 years of income/expense records, RPIE forms, or Schedule E." +65,No Change,Failure to abide by CCAO rule 17- failure to produce all required sales documentation. +66,No Change,Failure to abide by CCAO rule 15- failure to submit a recent original and clear picture of the front of the property (with the exception of Class 2) . +67,No Change,Failure to abide by CCAO rule 21- missing or incomplete evidence of demolition . 68,No Change,"This is the result of a recent field inspection and market, income, and/or comparable market analysis of your property." 69,Change,"This is the result of a recent field inspection and market, income, and/or comparable market analysis of your property." 7,Change,This is the result of the total vacancy of your property. From 322b20a44eb9263af7284e34fe8762d13f10d83d Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Wed, 9 Oct 2024 20:00:36 +0000 Subject: [PATCH 06/12] Move replace function for reason codes --- dbt/models/default/default.vw_pin_appeal.sql | 24 ++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/dbt/models/default/default.vw_pin_appeal.sql b/dbt/models/default/default.vw_pin_appeal.sql index 196f40754..0c320e166 100644 --- a/dbt/models/default/default.vw_pin_appeal.sql +++ b/dbt/models/default/default.vw_pin_appeal.sql @@ -5,27 +5,33 @@ WITH reasons AS ( -- Reason codes come from different columns before and after 2020 CASE WHEN htpar.taxyr <= '2020' - AND REPLACE(TRIM(SUBSTR(htpar.user42, 1, 2)), '.') NOT IN ( + AND TRIM(SUBSTR(htpar.user42, 1, 2)) NOT IN ( '0', ':' ) - THEN REPLACE(TRIM(SUBSTR(htpar.user42, 1, 2)), '.') - WHEN htpar.taxyr > '2020' THEN htpar.user89 + THEN TRIM(SUBSTR(htpar.user42, 1, 2)) + WHEN + htpar.taxyr > '2020' + THEN REGEXP_REPLACE(htpar.user89, '[^[:alnum:]]', '') END AS reason_code1, CASE WHEN htpar.taxyr <= '2020' - AND REPLACE(TRIM(SUBSTR(htpar.user43, 1, 2)), '.') NOT IN ( + AND TRIM(SUBSTR(htpar.user43, 1, 2)) NOT IN ( '0', ':' ) - THEN REPLACE(TRIM(SUBSTR(htpar.user43, 1, 2)), '.') - WHEN htpar.taxyr > '2020' THEN htpar.user100 + THEN TRIM(SUBSTR(htpar.user43, 1, 2)) + WHEN + htpar.taxyr > '2020' + THEN REGEXP_REPLACE(htpar.user100, '[^[:alnum:]]', '') END AS reason_code2, CASE WHEN htpar.taxyr <= '2020' - AND REPLACE(TRIM(SUBSTR(htpar.user44, 1, 2)), '.') NOT IN ( + AND TRIM(SUBSTR(htpar.user44, 1, 2)) NOT IN ( '0', ':' ) - THEN REPLACE(TRIM(SUBSTR(htpar.user44, 1, 2)), '.') - WHEN htpar.taxyr > '2020' THEN htpar.user101 + THEN TRIM(SUBSTR(htpar.user44, 1, 2)) + WHEN + htpar.taxyr > '2020' + THEN REGEXP_REPLACE(htpar.user101, '[^[:alnum:]]', '') END AS reason_code3 FROM {{ source('iasworld', 'htpar') }} AS htpar ) From 541affd03f5a0e3b5140d0f6878d0e8546a58b4d Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Wed, 9 Oct 2024 20:19:09 +0000 Subject: [PATCH 07/12] Update documentation, remove temp test limit --- dbt/models/default/default.vw_pin_appeal.sql | 6 +++--- dbt/models/default/schema/default.vw_pin_appeal.yml | 1 - dbt/seeds/ccao/docs.md | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dbt/models/default/default.vw_pin_appeal.sql b/dbt/models/default/default.vw_pin_appeal.sql index 0c320e166..cedea8dce 100644 --- a/dbt/models/default/default.vw_pin_appeal.sql +++ b/dbt/models/default/default.vw_pin_appeal.sql @@ -77,11 +77,11 @@ SELECT WHEN reasons.taxyr > '2020' THEN TRIM(LOWER(reasons.user104)) END AS change, reasons.reason_code1, - reascd1.description AS reason1, + reascd1.description AS reason_desc1, reasons.reason_code2, - reascd2.description AS reason2, + reascd2.description AS reason_desc2, reasons.reason_code3, - reascd3.description AS reason3, + reascd3.description AS reason_desc3, reasons.cpatty AS agent_code, htagnt.name1 AS agent_name, CASE diff --git a/dbt/models/default/schema/default.vw_pin_appeal.yml b/dbt/models/default/schema/default.vw_pin_appeal.yml index 1ea76e411..f19c3f284 100644 --- a/dbt/models/default/schema/default.vw_pin_appeal.yml +++ b/dbt/models/default/schema/default.vw_pin_appeal.yml @@ -108,7 +108,6 @@ models: - change config: where: CAST(year AS int) BETWEEN {{ var('data_test_iasworld_year_start') }} AND {{ var('data_test_iasworld_year_end') }} - error_if: ">2" - row_count: name: default_vw_pin_appeal_row_count above: 8407667 # as of 2023-11-22 \ No newline at end of file diff --git a/dbt/seeds/ccao/docs.md b/dbt/seeds/ccao/docs.md index acbbc935a..2300a7b5b 100644 --- a/dbt/seeds/ccao/docs.md +++ b/dbt/seeds/ccao/docs.md @@ -38,8 +38,8 @@ To find the level of assessment (LoA) for each class, see the `ccao.loa` table. # htpar_reascd {% docs seed_htpar_reascd %} -Table containing descriptions for reason codes from `iasworld.htpar`. -Reason codes pertian to appeal outcomes. +Table containing descriptions for appeal decision reason codes from +`iasworld.htpar`. **Primary Key**: `reascd` {% enddocs %} From cb2ba86df0da3e6ef2490ff6971ee2fcd7cf7b25 Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Wed, 9 Oct 2024 20:23:54 +0000 Subject: [PATCH 08/12] Commenting --- dbt/models/default/default.vw_pin_appeal.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbt/models/default/default.vw_pin_appeal.sql b/dbt/models/default/default.vw_pin_appeal.sql index cedea8dce..71b14be04 100644 --- a/dbt/models/default/default.vw_pin_appeal.sql +++ b/dbt/models/default/default.vw_pin_appeal.sql @@ -1,4 +1,7 @@ -- View containing appeals by PIN + +-- This CTE exists only so that we can join reason descriptions onto cleaned +-- reason codes. WITH reasons AS ( SELECT htpar.*, From ab45053a1460be0de3394d40b08a1bc36e8ee8ef Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Mon, 21 Oct 2024 18:01:45 +0000 Subject: [PATCH 09/12] Add additional appeal codes, improve documentation --- dbt/seeds/ccao/ccao.htpar_reascd.csv | 6 ++++-- dbt/seeds/ccao/docs.md | 2 +- dbt/seeds/ccao/schema.yml | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dbt/seeds/ccao/ccao.htpar_reascd.csv b/dbt/seeds/ccao/ccao.htpar_reascd.csv index 2a8cf7130..08a7498c1 100644 --- a/dbt/seeds/ccao/ccao.htpar_reascd.csv +++ b/dbt/seeds/ccao/ccao.htpar_reascd.csv @@ -11,7 +11,7 @@ reascd,outcome,description 18,No Change,This is due to lack of data having been submitted for our review. 19,No Change,This is due to insufficient data having been submitted for our review. 1A,Change,This is the result of an equity analysis of comparable properties. -2,Change,This is the result of an analysis of comparable properties. The decrease includes an update of your property's characteristics. +2,Change,This is the result of an analysis of comparable properties. The decrease includes an update of your property's characteristics. 20,No Change,This is due to the absence of or an incomplete Attorney/Representative Authorization form. 21,No Change,"This is due to the sale of the property not having been disclosed or incomplete sale data submitted. (i.e. closing statement, deed.)" 22,No Change,"This is due to income, market or cost analysis supporting the assessment." @@ -51,6 +51,7 @@ reascd,outcome,description 45A,No Change,The documents required to apply the affordable housing program reduction to your property were missing from your submission. 46,No Change,The property is railroad operational. 47,No Change,The property is currently partially exempt. +47A,Change,The property has been granted partial exempt status. 48,No Change,This result is based on consideration of submitted appraisal and an analysis of comparable properties. 48A,No Change,This result is based upon consideration of the appraisal submitted and an analysis of recent comparable property sales. 49,No Change,This is a result of a market analysis of your property as well as an analysis of comparable properties. @@ -93,8 +94,9 @@ reascd,outcome,description 83,No Change,"This is the result of market and comparable analysis of your property, which includes a home improvement exemption." 84,No Change,No evidence provided to warrant a field inspection. 85,No Change,Evidence provided contradicts recent field inspection. +86,Change,Cancellation of omitted assessment values as a result of a granted appeal. 88,No Change,Due to Legal Defense Denial. -88,No Change,Due to not submitting an appeal. +89,No Change,Due to not submitting an appeal. 9,Change,This is the result of a sale analysis of your property. 90,Change,This is the result of a special reduction reason. 9A,Change,This is the result of a comparable sales analysis of your property. diff --git a/dbt/seeds/ccao/docs.md b/dbt/seeds/ccao/docs.md index 2300a7b5b..ae735f59a 100644 --- a/dbt/seeds/ccao/docs.md +++ b/dbt/seeds/ccao/docs.md @@ -39,7 +39,7 @@ To find the level of assessment (LoA) for each class, see the `ccao.loa` table. {% docs seed_htpar_reascd %} Table containing descriptions for appeal decision reason codes from -`iasworld.htpar`. +`iasworld.htpar`. These codes are sourced directly from the iasWorld interface. **Primary Key**: `reascd` {% enddocs %} diff --git a/dbt/seeds/ccao/schema.yml b/dbt/seeds/ccao/schema.yml index 7601da920..13a5d7c71 100644 --- a/dbt/seeds/ccao/schema.yml +++ b/dbt/seeds/ccao/schema.yml @@ -110,6 +110,6 @@ seeds: description: '{{ doc("seed_htpar_reascd") }}' config: column_types: - reascd: string + description: string outcome: string - description: string \ No newline at end of file + reascd: string From 0f8439dc9e709cdba6e4bb59d4787f3a11297e66 Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Mon, 21 Oct 2024 18:08:38 +0000 Subject: [PATCH 10/12] Add additional documentation, temporarily allow build --- dbt/models/default/schema/default.vw_pin_appeal.yml | 1 + dbt/seeds/ccao/docs.md | 1 + 2 files changed, 2 insertions(+) diff --git a/dbt/models/default/schema/default.vw_pin_appeal.yml b/dbt/models/default/schema/default.vw_pin_appeal.yml index f19c3f284..69eb75ec9 100644 --- a/dbt/models/default/schema/default.vw_pin_appeal.yml +++ b/dbt/models/default/schema/default.vw_pin_appeal.yml @@ -108,6 +108,7 @@ models: - change config: where: CAST(year AS int) BETWEEN {{ var('data_test_iasworld_year_start') }} AND {{ var('data_test_iasworld_year_end') }} + error_if: ">1" - row_count: name: default_vw_pin_appeal_row_count above: 8407667 # as of 2023-11-22 \ No newline at end of file diff --git a/dbt/seeds/ccao/docs.md b/dbt/seeds/ccao/docs.md index ae735f59a..728224b7c 100644 --- a/dbt/seeds/ccao/docs.md +++ b/dbt/seeds/ccao/docs.md @@ -40,6 +40,7 @@ To find the level of assessment (LoA) for each class, see the `ccao.loa` table. {% docs seed_htpar_reascd %} Table containing descriptions for appeal decision reason codes from `iasworld.htpar`. These codes are sourced directly from the iasWorld interface. +Many (but not all) are documented on the [Assessor's website](https://www.cookcountyassessor.com/form-document/assessor-reason-codes). **Primary Key**: `reascd` {% enddocs %} From f6f5fafe230414487c8ea65613fcd9b3be6642a6 Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Mon, 21 Oct 2024 18:19:36 +0000 Subject: [PATCH 11/12] Improve `change` recode specificity --- dbt/models/default/default.vw_pin_appeal.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbt/models/default/default.vw_pin_appeal.sql b/dbt/models/default/default.vw_pin_appeal.sql index 71b14be04..124b8093b 100644 --- a/dbt/models/default/default.vw_pin_appeal.sql +++ b/dbt/models/default/default.vw_pin_appeal.sql @@ -77,7 +77,10 @@ SELECT WHEN reasons.taxyr > '2020' AND TRIM(LOWER(reasons.user104)) = 'decrease' THEN 'change' - WHEN reasons.taxyr > '2020' THEN TRIM(LOWER(reasons.user104)) + WHEN + reasons.taxyr > '2020' + AND TRIM(LOWER(reasons.user104)) IN ('change', 'no change') + THEN TRIM(LOWER(reasons.user104)) END AS change, reasons.reason_code1, reascd1.description AS reason_desc1, From d7a67ee0d1ee52f6b6f397b193e0f65811090716 Mon Sep 17 00:00:00 2001 From: Sweaty Handshake Date: Mon, 21 Oct 2024 18:20:08 +0000 Subject: [PATCH 12/12] Remove temp build allowance --- dbt/models/default/schema/default.vw_pin_appeal.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/dbt/models/default/schema/default.vw_pin_appeal.yml b/dbt/models/default/schema/default.vw_pin_appeal.yml index 69eb75ec9..f19c3f284 100644 --- a/dbt/models/default/schema/default.vw_pin_appeal.yml +++ b/dbt/models/default/schema/default.vw_pin_appeal.yml @@ -108,7 +108,6 @@ models: - change config: where: CAST(year AS int) BETWEEN {{ var('data_test_iasworld_year_start') }} AND {{ var('data_test_iasworld_year_end') }} - error_if: ">1" - row_count: name: default_vw_pin_appeal_row_count above: 8407667 # as of 2023-11-22 \ No newline at end of file