As @Ed_ mentioned in Split comma separated values to multiple rows:
...I am trying to split each comma separated value in `MUNICIPALI` column [into rows] as shown in desired output.
Sample Data:
OBJECTID | PRJTID | MUNICIPALI | ZIPCODE |
1 | 1 | A | 1 |
2 | 2 | A, B | 1,2 |
3 | 3 | A, B, C | 1,2,3 |
4 | 4 | A, B, C, D | 1,2,3,4 |
5 | 5 | A | 1 |
6 | 6 | C | 3 |
Desired output:
OBJECTID | PRJTID | MUNICIPALI | ZIPCODE |
1 | 1 | A | 1 |
2 | 2 | A | 1 |
3 | 2 | B | 2 |
4 | 3 | A | 1 |
5 | 3 | B | 2 |
6 | 3 | C | 3 |
7 | 4 | A | 1 |
8 | 4 | B | 2 |
9 | 4 | C | 3 |
10 | 4 | D | 4 |
11 | 5 | A | 1 |
12 | 6 | C | 3 |
Could an OOTB geoprocessing tool be added that could split comma-separated values into rows?
Now that Summary Statistics (Analysis)—ArcGIS Pro | Documentation supports concatenation, we need a tool to do the inverse.
Either
The splitting tools in the Extract toolset do not address this need for several reasons.
I like your diagram.
Related idea: GP tool to split field with comma-delimited values into multiple rows
Bud, I thought I saw a similar idea in the past but couldn't find it while searching, hence me posting it. For now, I will leave my idea up too and Esri can decide to merge them or not.
@JoshuaBixby your idea has been merged here. Your diagram is really nice!
Can you explain what process requires the multiple rows or why you want to "explode" the concatenated values to multiple rows? Your diagram and the previous explanation are very clear about what the request is, and the arcgis-pro-question at the top has a code sample to accomplish this.
A subtle difference in the original request seems to be exploding multiple fields. I don't know if the matching of the items between two or more fields is expected to me at least -- PRJTID=2 turns into two records based on positional matching, rather than exploding to rows with all possible combinations.
@DrewFlater, I don't know if what Bud and I have in mind are exactly the same, but they are similar enough to merge for discussion on the requests.
Looking at the original example, it appears the OP is asking for a pairwise combination, one might call it "zipping". I am more interested in a cross product that results in a straight combination if multiple fields are selected. For example,
OBJECTID | PRJTID | MUNICIPALI | ZIPCODE |
2 | 2 | A | 1 |
3 | 2 | A | 2 |
4 | 2 | B | 1 |
5 | 2 | B | 2 |
The main use case I have run across is a form of re-normalizing tables from data warehouses. Re-normalizing redundant attribution can be as straightforward as removing columns, but when information has been concatenated for reporting purposes the attribution needs to be exploded.
I realize there is readily available code for doing this task, and I am a big advocate for scripting over GUI-driven clickops, but I also work in and support an organization with tens of thousands of GIS users and a vast majority of those users solely rely on the GUI and geoprocessing tools.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.