I working with ModelBuilder and I have two summary statistics tools, with 'case fields' that have multiple sum values, I want to use these sum values from one table and divide the sum values from the other table to get percentages,I have added a field in one table to store the percentages. I am using Iterate Field Values tool to get the output values that I can input into Calculate field to get the percentage, it works but only for the first record, obviously because it is only getting one value from the summary tables, I tried Collect values tool to get multiple values, but I get an error 000539, I using the code from this discussion: How to extract multiple values out of a table in ModelBuilder
I have more than than 2 values so I guess List and not index is required.
The whole model runs I get all the results, except the error with collect Value tool. Here is snap shot of the model,
I will separate the iterator tool and add it as submodel once it works.
Here are the input tables and I want to calculate PctCtyPop using calculate field by dividing the 2 SUM_POPULATION,
it giving me the right value for the 1st record 5505/20202 but for the second instead of getting 118774/131506, it is giving some thing else.