Skip to content

Conversation

@Damonamajor
Copy link
Contributor

@Damonamajor Damonamajor commented Nov 5, 2025

Tieback PINs come from the following queries. I put more specified ones regarding the individual PINs in the ‎pipeline/02-assess.R file. I kept the context surrounding decision making to a minimum since some of that will likely change.

SELECT meta_tieback_key_pin,
       meta_pin_num_cards
FROM "model"."assessment_pin"
WHERE run_id = '2025-02-11-charming-eric'
  AND meta_tieback_key_pin IS NOT NULL
  AND meta_tieback_key_pin IN (
      SELECT meta_tieback_key_pin
      FROM "model"."assessment_pin"
      WHERE run_id = '2025-02-11-charming-eric'
        AND meta_tieback_key_pin IS NOT NULL
      GROUP BY meta_tieback_key_pin
      HAVING COUNT(DISTINCT meta_pin_num_cards) > 1
  )
ORDER BY meta_tieback_key_pin, meta_pin_num_cards
select *
from model.assessment_pin
where run_id = '2025-02-11-charming-eric'
and 
flag_land_value_capped = true
and 
meta_tieback_key_pin
 is not null
and meta_tieback_proration_rate < 1
SELECT meta_tieback_key_pin
FROM "model"."assessment_pin"
WHERE run_id = '2025-02-11-charming-eric'
and meta_pin_num_cards > 1
GROUP BY meta_tieback_key_pin
HAVING COUNT(DISTINCT meta_complex_id) > 1
SELECT
  ap.meta_tieback_key_pin,
  ap.meta_pin,
  ap.meta_pin_num_cards,
  ac.meta_card_num,
  ac.char_land_sf
FROM "model"."assessment_pin" ap
JOIN "model"."assessment_card" ac
  ON  ac.meta_pin = ap.meta_pin
  AND ac.run_id   = ap.run_id
WHERE ap.run_id = '2025-02-11-charming-eric'
  AND ap.meta_tieback_key_pin IN ('09263150040000', '09221110050000')
ORDER BY ap.meta_pin, ac.meta_card_num

@Damonamajor Damonamajor linked an issue Nov 5, 2025 that may be closed by this pull request
@Damonamajor Damonamajor self-assigned this Nov 5, 2025

# PINs can be multi-card, and have different numbers of cards.
# In stage 3.1, tieback PIN 05283170010000 has PINs with 2 and 3 cards,
# and tieback PIN 01131010080000 has PINs with 1 and 2 cards.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select meta_tieback_key_pin, meta_pin_num_cards, meta_pin
  FROM "model"."assessment_pin"
  where meta_tieback_key_pin IN ('05283170010000', '01131010080000')
  and run_id = '2025-02-11-charming-eric'

# We currently group by meta_tieback_key_pin, meta_card_num, and char_land_sf.
# Values for char_land_sf can be both the same and different in each tieback
# grouping. For example, tieback PIN 05283170010000 has 5 total cards with the
# same SQ footage, and tieback PIN 05283170030000 has 5 total cards with two
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SELECT
  ap.meta_tieback_key_pin,
  ap.meta_pin,
  ap.meta_pin_num_cards,
  ac.meta_card_num,
  ac.char_land_sf
FROM "model"."assessment_pin" ap
JOIN "model"."assessment_card" ac
  ON  ac.meta_pin = ap.meta_pin
  AND ac.run_id   = ap.run_id
WHERE ap.run_id = '2025-02-11-charming-eric'
  AND ap.meta_tieback_key_pin IN ('09263150040000', '09221110050000', '05283170010000', '05283170030000')
ORDER BY ap.meta_pin, ac.meta_card_num

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One observation with matching Card values and one with different Card values,

# 09263150040000 has three cards for each PIN with different SQ footage values.

# They can also have capped land values in stage 4. An example of capped value
# are tieback PINs 16012030310000 or 29071130320000
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select meta_tieback_key_pin, meta_pin_num_cards, meta_pin, flag_land_value_capped
  FROM "model"."assessment_pin"
  WHERE meta_tieback_key_pin IN ('16012030310000', '29071130320000')
  and run_id = '2025-02-11-charming-eric'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the only observation which really differs by run_id

# They can also be part of town-home complexes (Stage 3.2). Town-home complexes
# are grouped based on different characteristics, such as the number of rooms,
# square footage, or proration rate, meaning tiebacks can be averaged in
# separate groupings (tieback PINs 15213010030000 or 30171010230000)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select meta_tieback_key_pin, meta_pin_num_cards, meta_pin, meta_complex_id
  FROM "model"."assessment_pin"
  WHERE meta_tieback_key_pin IN ('15213010030000', '30171010230000')
  and run_id = '2025-02-11-charming-eric'

@Damonamajor Damonamajor marked this pull request as ready for review November 5, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add comments and example PINs to help explain proration

1 participant