Splitting data in an attribute table into multiple fields

4216
12
Jump to solution
06-08-2021 01:37 AM
SimonCrutchley
Occasional Contributor III

I have data in a concatenated list, created so that it is searchable in a single attribute, but I now discover that I need to make hyperlinks to the various entries 

The easiest way to do this seems to be to split them into separate entries and then do a link to each unique entry, as there are far too many different combinations. 

I currently have the concatenated fields separated by / e.g. the field currently called 'TYPE' has entries such as 'ENCLOSURE/FIELD/FIELD SYSTEM/SETTLEMENT' and I would like this to become a number of separate new fields TYPE1 = 'ENCLOSURE', TYPE2 = 'FIELD', TYPE3 = 'FIELD SYSTEM' etc

I attach a sample of a file where I did the split manually, to see if the process would produce the data in a form that I could then use in Portal, in a pop-up.

Hope you can help

Thanks

I suspect this may be similar to the solution given to another post I had Splitting data in an attribute table 

 

0 Kudos
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

Since the question was posted in ArcGIS Online space, I provided solution in ArcGIS Online.

In ArcGIS Online (Map Viewer)

JayantaPoddar_0-1623151582029.png

 

In ArcGIS Pro, use Calculate Field.

JayantaPoddar_1-1623151818435.png

 



Think Location

View solution in original post

0 Kudos
12 Replies
JayantaPoddar
MVP Esteemed Contributor

If you are sharing the data as a hosted feature layer in your ArcGIS Enterprise Portal/ ArcGIS Online, you can calculate field with the following Arcade expressions.

Type1:

Split($feature.NARROWTYPE,'\\')[0]

Type2:

Split($feature.NARROWTYPE,'\\')[1]

Type3:

Split($feature.NARROWTYPE,'\\')[2]

 

JayantaPoddar_2-1623148838508.png

 

 

JayantaPoddar_1-1623148541485.png

Edit: In the above sample, a few records missed "\" between ENCLOSED and FIELD SYSTEM, resulting in the Type1 field having value of "ENCLOSED FIELD SYSTEM". So desired substrings are separated by appropriate character (backslash in this case).



Think Location
0 Kudos
SimonCrutchley
Occasional Contributor III

Thanks for that,

I will eventually be sharing it online, so might be able to do this, if I knew where to find it. However, I've tended to make the changes in ArcMap or Pro and then import them.

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Since the question was posted in ArcGIS Online space, I provided solution in ArcGIS Online.

In ArcGIS Online (Map Viewer)

JayantaPoddar_0-1623151582029.png

 

In ArcGIS Pro, use Calculate Field.

JayantaPoddar_1-1623151818435.png

 



Think Location
0 Kudos
SimonCrutchley
Occasional Contributor III

Incidentally, in this case 'ENCLOSED FIELD SYSTEM' is a correct type; there are open FIELD SYSTEMs and 'ENCLOSED FIELD SYSTEMs, so the process has worked. 🙂

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Cool. 👍



Think Location
0 Kudos
SimonCrutchley
Occasional Contributor III

However, unfortunately this still doesn't help, as I don't know where to find the 'arcade calculator' or how to use it. Please could you give me a bit more detail?

Thanks

0 Kudos
SimonCrutchley
Occasional Contributor III

Right, so I run it with [0] for the first entry. [1] for the second etc?

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

That's right. Choose "Arcade" as the expression type in Calculate Field in ArcGIS Pro.



Think Location
SimonCrutchley
Occasional Contributor III

Oops 🤔. It works for the first one, but the second gives me an error. I think I've copied what you wrote, but may have something wrong? Sorry

SimonCrutchley_0-1623156065963.png

 

0 Kudos