Some of you have, in the past, very helpfully provided me with guidance, and indeed scripts for sorting data from ‘/’ separated strings into individual entries and also sorting and removing duplicates from these strings. This works fine for my ‘Type’ data which can happily be sorted alphabetically. Unfortunately, the same cannot be said for my ‘Period’ data, which needs to be in date order. Unfortunately, again, it’s not actual dates, which could be sorted numerically, but rather periods written as text e.g. Roman, Iron Age, Medieval.
I tried to rename the data, adding a number at the beginning, but I hit a snag in that there are entries with duplicate words e.g. MEDIEVAL, POST MEDIEVAL, IRON AGE, EARLY IRON AGE etc and it’s tricky to edit the string for MEDIEVAL, without also editing POST MEDIEVAL; instead you have to edit everything MEDIEVAL, then all the POST or other MEDIEVALs, which is a hassle.
I’m wondering whether there is a way of using some sort of predefined list to create the order?
Thanks
One workflow I can think of is you have two attribute fields, one call EPOCH or PERIOD where you have attribute values of MEDIEVAL, POST MEDIEVAL, IRON AGE, EARLY IRON AGE and so. Then another attribute field (short integer) that you field calculate where MEDIEVAL = 1 and POST MEDIEVAL = 2 and so on. If you want the attribute table to be permanently sorted by PERIOD, then use the Sort (Data Management Tools) | ArcGIS Pro documentation to sort by attribute. Is this what you're attempting to accomplish or am I off?
Hi Robert,
Sort of. My issue is that the querying in AGOL, using the data from Pro has to be done by text; I can't expect users to know that Neolithic = 3 and Post Medieval = 17 etc. Furthermore, as well as users to being able to query by text, I also need to display the concatenated data e.g. IRON AGE\ROMAN for those just viewing.
I'm afraid I don't understand enough of what you've suggested to know whether I could this?
Sorry
I know in ArcGIS Experience Builder, you can create a predefined unique values in a specific order for the Query widget and Select widgets. I'm pretty sure the ArcGIS Online Map Viewer doesn't support a predefined or custom order list the way ExB does...
I've built my app in ExB so that shouldn't be a problem. The issue is that the query has to be a 'contains' rather than an 'equals' or a 'select from a picklist' due to the variety of combinations e.g. IRON AGE\ROMAN; IRON AGE\LATE PREHISTORIC\ROMAN; IRON AGE\ROMAN\MEDIEVAL etc
GREAT! So in my screen grab below, I have a Query widget where I created a picklist of combinations that you provided (and I'm guessing for order) where the user would pick the value of interest, then click Apply to complete the query. Are we getting close?
Sadly not :(. Because of the variety of combinations, there are literally hundreds of possible options, so a picklist isn't viable.
Hmmm...I did get the CONTAINS working on the text field. The key is creating the perhaps LONG list of combinations you mentioned but this is just picking on the initial creation.