Can we programmatically change incorrect condo unit count data without erroneously changing valid data? If not, we can create a report with candidates for correction and add manual corrections.
The pseudo code below might catch the worst offenders, hopefully without picking up false positives.
For unit BBLs having the same billing BBL, if more than 5 unit BBLs have the same value for coop_apts, and that value is not a 0 or 1, the resunits for the billing BBL should be set equal to that value.
The number 5 is arbitrary and could be adjusted (we didn't need to find all the issues, just the ones that most impact the totals). We'd need to create and review a report with condos that get corrected.