ccao-data / data-architecture

Codebase for CCAO data infrastructure construction and management
https://ccao-data.github.io/data-architecture/
6 stars 4 forks source link

Update land sf calculations with new split class influence reason #321

Closed wrridgeway closed 7 months ago

wrridgeway commented 7 months ago

One of the updates in iasWorld that was implemented between 2023 and 2024 was the addition of a new field to handle prorations of land values. This was specifically needed for Condos, as their % owner interest amounts often have very specific values that go well to the right of the decimal. The closest thing that was in place to handle land prorations was the influence factor, but that only can divide to whole percentages. So for Condos, they were only using overrides for entering the values previously given this issue, but for split class properties where the prorations are typically in whole percentages, they used the influence factors. In these instances, the SF for the land for the parcel repeats on the various lines, as it's just using the factors to divide the values. With the new proration field, we have gone through the process of moving those influence factor values to the new proration fields.

So, in essence nothing actually changed as we just moved these values that were providing the split of the land into the various classes. But, there are a number of instances where we have left influence factor values and not moved them to the proration field, as those were using it for a different reason where it was just reducing the value for reasons not related to a split class proration. For the instances where we are using the proration field for these split classes, we have also entered an Influence Reason to indicate "Split Class Parcel". As far as it impacts you all, you can know that when the Reason is indicating Split Class Parcel, that you only need to count the land SF once for that PIN.

wrridgeway commented 7 months ago
WITH old AS (
    SELECT year, AVG(sf) AS old
    FROM default.vw_pin_land
    GROUP BY year
),
new AS (
    SELECT year, AVG(sf) AS new
    FROM "z_ci_320-update-land-sf-calculations-with-new-split-class-influence-reason_default".vw_pin_land
    GROUP BY year
)

SELECT
    old.year,
    old.old,
    new.new
FROM old
LEFT JOIN new ON old.year = new.year
ORDER BY year DESC
year old new
1999 198705 198705
2000 195190 195190
2001 191398 191398
2002 188815 188815
2003 181481 181481
2004 104909 104909
2005 68740 68740
2006 48202 48202
2007 49061 49061
2008 50477 50477
2009 50644 50644
2010 50799 50799
2011 50768 50768
2012 50964 50964
2013 50921 50921
2014 50875 50875
2015 50905 50905
2016 50797 50797
2017 50779 50779
2018 50801 50801
2019 50770 50770
2020 57684 57684
2021 51419 51419
2022 84057 84057
2023 54361 54361
2024 54389 54384

This is what we expect to see since the split class changes were only implemented this year.