Hello, I am attempting to create a tool that allows for the clustering of polygon features into different groups based the sum of values (Housing_Unit field) of the polygon features. (Example: Using a maximum of 600 housing units to divide the features into separate groups). The tool is designed such that if the sum of values is more than the specified value parameter (Example: 200 < 500 (parameter)), the tool will stop. However the tool only stops after the sum of values violates the specified value, thus the features grouped includes the feature that caused the entire group to violate the parameter. I would like it such that the tool does not consider the features that caused the sum of value to violate the parameter, but I am unsure of the Python expression to do so, as I am still new to coding (and python). My expression to set the constraint is
" %sum_of_housing_units% < %housing_units_parameter% " My arcmap is advanced licensed.