# Field map — what the comp process reads from the data

The dataset is a slimmed MLS export: 33 columns, sale and lease records side
by side. `PropertyType` separates the two markets, and the process never mixes
them in one comp set.

## Required — the analysis cannot run without these

| Column | Why it is required |
|---|---|
| `StandardStatus` | Only `Closed` listings become comps. Actives are asking prices, not evidence. |
| `PropertyType` | Sale vs lease — the market wall. |
| `PropertySubType` | A condo is not a comp for a detached house. |
| `City` | Market boundary. |
| `BedroomsTotal` / `BathroomsTotalInteger` | Selection filters and adjustments. |
| `LivingArea` | Price-per-sqft, the size adjustment, the size band. |
| `ClosePrice` | The number everything derives from. |
| `CloseDate` | The lookback window. |
| `YearBuilt` | Age filter and adjustment. |
| `Latitude` / `Longitude` | The radius filter, distance ranking, and the map. |

## Matching — the columns behind the ranking rules

| Column | Role |
|---|---|
| `SubdivisionName` | The tract. Tract-first ranking; near-model matches. |
| `BuilderModel` | The model, where present (sparse) — strongest possible match. |
| `Levels` / `StoriesTotal` | A two-story is a different product from a single-level. |
| `PropertyAttachedYN` / `CommonWalls` | The attached/detached wall, even when subtype is sloppy. |

## Optional — improve the result, never block it

| Column | Effect if absent |
|---|---|
| `ListingId` | The audit trail — every comp in a report carries it. |
| `GarageSpaces`, `ViewYN`, `PoolPrivateYN`, `Furnished` | Their adjustments are skipped (unknown is not "no"). |
| `StreetNumberNumeric` / `StreetName` / `StreetSuffix` / `UnitNumber` | Addresses degrade. |
| `ListPrice`, `OriginalListPrice`, `DaysOnMarket`, `LotSizeSquareFeet`, `PostalCode`, `MLSAreaMajor` | Context only. |

## Traps in this data — real, observed, and why the rules exist

1. **Dates read `MM/DD/YYYY 12:00:00 AM`** (sometimes `M/D/YYYY H:MM`).
   Compare as dates, never as text — text-sorted, `01/04/2026` lands before
   `12/05/2025` and a lookback filter grabs the wrong year.
2. **Condo complexes share one geocode.** Several listings — sometimes
   including the subject — carry identical coordinates because the MLS
   geocodes the complex, not the unit. This is why the map fans out stacked
   pins instead of letting them bury each other.
3. **The same address closes more than once** (especially leases). One
   property with a history, not two properties — but it double-weights a comp
   set, so say so when it happens.
4. **Price-per-sqft outliers are real.** The low end is usually a room rental
   or partial lease; note them, do not silently drop them.
5. **A raw 596-column export repeats some column names** and most of its
   columns are empty. The slim dataset avoids this; when handed a raw export,
   use the copy of a duplicated column that actually has values.
6. **`BuilderModel` is sparse** (~5–10% populated). Treat a model match as a
   bonus, never a requirement.
