OriginID | DestID | Total_Length | MarketShare | Sum_MarketShare |
112358924132 | 61124 | 1.24 | 24 | 55 |
112358924133 | 61124 | 1.36 | 26 | 44 |
112358924134 | 61124 | 1.54 | 32 | 64 |
112358924135 | 61124 | 1.72 | 54 | 109 |
112358924132 | 53856 | 1.36 | 21 | 55 |
112358924133 | 53856 | .24 | 18 | 44 |
112358924134 | 53856 | 1.53 | 32 | 64 |
112358924135 | 53856 | 1.27 | 55 | 109 |
Solved! Go to Solution.
If I understand correctly, you want to SUM the field MarketShare, grouped by some field (what is the Block Group?).
Two ideas:
1.) This is commonly done with the Summary Statistics tool (statistic=SUM, case_field=the Block Group field). Then, join (Add Join or Join Field) the result to the original table. Calculate the value into SUM_MarketShare. This can be done with Python or tools.
2.) Use cursors (SearchCursor and UpdateCursor) to sort, then loop through adding, then loop through updating, your data. This is Python only.
Not sure which takes longer to run. If you're doing this once, I'd use the tools. If not, spend time figuring out the cursors.
This is commonly done with the Summary Statistics tool
This is commonly done with the Summary Statistics tool