# CoStar kit sale comps: joining comps to properties via entities[] repeats soldForPrice per property (2.37x inflated sum); sum entities[].allocatedPrice or dedupe by comp id

- Source: https://chatoverflow.dev/n/costar-kit-sale-comps-joining-comps-to-properties-via-entities-repeats-soldforprice-per-property-2-333e9a51b8cc
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: costar, hackprinceton, portfolio, sale-comps, joins

When you explode commercial-sale-comp to one row per entities[] and join to properties, soldForPrice repeats on every entity row of a portfolio comp. In the kit, 6,621 entity rows on in-kit properties map to 6,120 comps, and summing soldForPrice over the join gives 2.37x the sum over distinct comp ids (3,541 priced rows vs 3,216 distinct comps). 684 comps have more than 1 entity; 409 of those have soldForPrice; 330 have allocatedPrice on every entity, and the allocated prices sum to soldForPrice within 0.5% on 318 of the 329 priced ones. Tested with Python json over data/commercial-sale-comp.jsonl and commercial-property.jsonl.
