Greetings all-
I need to merge two summary results together to use in a serial chart in Dashboard. The summary tables/results look like the following:
Summary 1 - NO_LOSS_TYPE1
| Category | FeatureCount | FID |
| A - No Impact | 35 | 0 |
| B - Material Excavation | 2 | 1 |
| D - Habitat Restoration | 3 | 2 |
| E - Stormwater Excavation | 8 | 3 |
| F - Utilities | 2 | 4 |
| H - Temporary Impact | 14 | 5 |
Summary 2 - NO_LOSS_TYPE2
| Category | FeatureCount | FID |
| B - Material Excavation | 1 | 0 |
| E - Stormwater Excavation | 3 | 1 |
| F - Utilities | 1 | 2 |
| H - Temporary Impact | 2 | 3 |
As you can see, sometimes the "Category" value matches. If it matches the two result sets, I want to add the "FeatureCount" values together. If the "Category" value doesn't exist, I want to append/add it to the output results.
So I'd ultimately like to end up with something like the following:
| Category | FeatureCount | FID |
| A - No Impact | 35 | 0 |
| B - Material Excavation | 3 (i.e., 2 + 1) | 1 |
| D - Habitat Restoration | 3 | 2 |
| E - Stormwater Excavation | 11 (i.e,. 8 + 3) | 3 |
| F - Utilities | 3 (i.e., 3 + 1) | 4 |
| H - Temporary Impact | 16 (i.e., 14 + 2) | 5 |
I've managed to get the summary results okay, but am struggling with where to go next. I've added those summary results to a dictionary, but then have trouble finding the corresponding keys in either of the dictionaries while trying to "merge" the two of them together. I've been looping through one dictionary and using "HasKey()" to see if it has a corresponding key from the second dictionary, but that hasn't been finding the keys. My "input" dictionaries look like this:
Dictionary 1
{"fields":[{"name":"Category","type":"esriFieldTypeString"},{"name":"FeatureCount","type":"esriFieldTypeInteger"}],"geometryType":"","features":[{"attributes":{"Category":"A - No Impact","FeatureCount":35}},{"attributes":{"Category":"B - Material Excavation","FeatureCount":2}},{"attributes":{"Category":"D - Habitat Restoration","FeatureCount":3}},{"attributes":{"Category":"E - Stormwater Excavation","FeatureCount":8}},{"attributes":{"Category":"F - Utilities","FeatureCount":2}},{"attributes":{"Category":"H - Temporary Impact","FeatureCount":14}}]}
Dictionary 2
{"fields":[{"name":"Category","type":"esriFieldTypeString"},{"name":"FeatureCount","type":"esriFieldTypeInteger"}],"geometryType":"","features":[{"attributes":{"Category":"B - Material Excavation","FeatureCount":1}},{"attributes":{"Category":"E - Stormwater Excavation","FeatureCount":3}},{"attributes":{"Category":"F - Utilities","FeatureCount":1}},{"attributes":{"Category":"H - Temporary Impact","FeatureCount":2}}]}
Any help is greatly appreciated!