{"ref":{"kind":"component","id":"lease_calendar","key":"sha256:40cd10759cf8d7a00226c30395712e4ba782736fbbc740a27a9e4aa98d922197"},"label":"Lease Calendar","description":"Project lease expirations and classic-unit availability from dated unit rows.","inputs":[{"label":"Classic","name":"classic","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"f64","unit":"flag"}},{"label":"Detail","name":"detail","valueType":{"axes":[],"dtype":"f64","unit":"flag"}},{"label":"Occupied","name":"occupied","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"bool","unit":"1"}},{"label":"Rent Roll As Of Date","name":"rent_roll.as_of_date","valueType":{"axes":[],"dtype":"str","unit":"date"}},{"label":"Rent Roll Floorplan","name":"rent_roll.floorplan","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"str","unit":"text"}},{"label":"Rent Roll Lease End","name":"rent_roll.lease_end","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"str","unit":"date"}},{"label":"Rent Roll Lease Start","name":"rent_roll.lease_start","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"str","unit":"date"}},{"label":"Unit Mix Floorplans","name":"unit_mix.floorplans","valueType":{"axes":[{"extent":null,"name":"unit","variable":true}],"dtype":"str","unit":"text"}},{"label":"Units","name":"units","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"f64","unit":"units"}}],"outputs":[{"label":"Availability","name":"availability","valueType":{"axes":[{"extent":121,"name":"month","variable":false},{"extent":null,"name":"unit","variable":true}],"dtype":"f64","unit":"units"}},{"label":"End Dates","name":"end_dates","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"str","unit":"date"}},{"label":"End Months","name":"end_months","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"f64","unit":"mo"}},{"label":"Expirations","name":"expirations","valueType":{"axes":[{"extent":121,"name":"month","variable":false}],"dtype":"f64","unit":"units"}},{"label":"Start Dates","name":"start_dates","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"str","unit":"date"}},{"label":"Start Months","name":"start_months","valueType":{"axes":[{"extent":null,"name":"rent_roll","variable":true}],"dtype":"f64","unit":"mo"}}],"dependencies":[],"libraries":["multifamily_roll"],"notes":{},"calculation":{"nodes":[{"id":"input-classic","label":"Classic","kind":"input"},{"id":"input-detail","label":"Detail","kind":"input"},{"id":"input-occupied","label":"Occupied","kind":"input"},{"id":"input-rent_roll.as_of_date","label":"Rent Roll As Of Date","kind":"input"},{"id":"input-rent_roll.floorplan","label":"Rent Roll Floorplan","kind":"input"},{"id":"input-rent_roll.lease_end","label":"Rent Roll Lease End","kind":"input"},{"id":"input-rent_roll.lease_start","label":"Rent Roll Lease Start","kind":"input"},{"id":"input-unit_mix.floorplans","label":"Unit Mix Floorplans","kind":"input"},{"id":"input-units","label":"Units","kind":"input"},{"id":"step-value2","label":"if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”","kind":"step","rule":"if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”","sources":[{"node":"input-detail"},{"node":"input-rent_roll.as_of_date"}]},{"id":"step-end_dates","label":"End Dates","kind":"step","rule":"if (Rent Roll Lease End = “”), then if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”, otherwise Rent Roll Lease End","sources":[{"node":"input-rent_roll.lease_end"},{"node":"step-value2"}]},{"id":"step-start_dates","label":"Start Dates","kind":"step","rule":"if (Rent Roll Lease Start = “”), then if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”, otherwise Rent Roll Lease Start","sources":[{"node":"input-rent_roll.lease_start"},{"node":"step-value2"}]},{"id":"step-end_months","label":"End Months","kind":"step","rule":"Date month offset(if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”, End Dates)","sources":[{"node":"step-end_dates"},{"node":"step-value2"}],"calls":[{"function":"rent_roll_month_offset","label":"Rent roll month offset","bindings":[{"name":"end","label":"End","value":"End Dates"},{"name":"start","label":"Start","value":"if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”"}],"purpose":"Count the calendar months from the starting date to each ending date. Dates in the same calendar month have an offset of zero.","rule":"Date month offset(if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”, End Dates)"}]},{"id":"output-end_dates","kind":"output","label":"End Dates","rule":"End Dates","sources":[{"node":"step-end_dates"}]},{"id":"output-start_dates","kind":"output","label":"Start Dates","rule":"Start Dates","sources":[{"node":"step-start_dates"}]},{"id":"output-start_months","kind":"output","label":"Start Months","rule":"Date month offset(if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”, Start Dates)","sources":[{"node":"step-start_dates"},{"node":"step-value2"}],"calls":[{"function":"rent_roll_month_offset","label":"Rent roll month offset","bindings":[{"name":"end","label":"End","value":"Start Dates"},{"name":"start","label":"Start","value":"if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”"}],"purpose":"Count the calendar months from the starting date to each ending date. Dates in the same calendar month have an offset of zero.","rule":"Date month offset(if Detail, then Rent Roll As Of Date, otherwise “1900-01-01”, Start Dates)"}]},{"id":"step-value1","label":"Higher of End Months and 0","kind":"step","rule":"Higher of End Months and 0","sources":[{"node":"step-end_months"}]},{"id":"output-end_months","kind":"output","label":"End Months","rule":"End Months","sources":[{"node":"step-end_months"}]},{"id":"step-value0","label":"Conditional result using Occupied","kind":"step","rule":"if Occupied, then Higher of Higher of End Months and 0 and 1, otherwise 0","sources":[{"node":"input-occupied"},{"node":"step-value1"}]},{"id":"output-expirations","kind":"output","label":"Expirations","rule":"Sum by group(if (Higher of End Months and 0 ≤ Value at index(consecutive values from 0 to 120, -1)), then if Occupied, then Units, otherwise 0, otherwise 0, Lower of Higher of End Months and 0 and Value at index(consecutive values from 0 to 120, -1), consecutive values from 0 to 120)","sources":[{"node":"step-value1"},{"node":"input-occupied"},{"node":"input-units"}]},{"id":"output-availability","kind":"output","label":"Availability","rule":"Sum by row and column group(if if Classic, then if (Conditional result using Occupied ≤ Value at index(consecutive values from 0 to 120, -1)), then true, otherwise false, otherwise false, then Units, otherwise 0, Lower of Conditional result using Occupied and Value at index(consecutive values from 0 to 120, -1), Rent Roll Floorplan, consecutive values from 0 to 120, Unit Mix Floorplans)","sources":[{"node":"input-classic"},{"node":"step-value0"},{"node":"input-units"},{"node":"input-rent_roll.floorplan"},{"node":"input-unit_mix.floorplans"}]}],"topics":[{"label":"Lease Calendar","results":["output-availability","output-end_dates","output-end_months","output-expirations","output-start_dates","output-start_months"]}]},"usedBy":[{"kind":"recipe","id":"multifamily","key":"sha256:397eeb7b5a8b1a4584c66bc4c75f1a85494dbe812871f2e39c9192beb8a51f18"}]}
