Summarize a field containing a list of values

01-14-2023 01:22 PM
New Contributor III

Has anyone tried to summarize a field that contains a list of values?  I have a field that contains a list of multiple values like a typical tag field. 

For example:

1a, c
2a, c, d
3a, b, c, d


I am trying to create a chart of the count of each value in the list from the ListAttribute field. 

The input would look something like this:



Is this possible in Insights?  Would this have to be done in a preprocessing step?  This data originates from SQL server.

Any thoughts would be helpful.



0 Kudos
3 Replies
Esri Contributor

@mklatt_cityofventura_ca_gov ,

That's a good question. This can be done in Insights by using the scripting console and essentially breaking the values from {ListAttribute} into different rows, then using the Summary Table to get a count for each value.

I'm using Python with pandas here but there are several options.

1. Import the data and convert the string values to a python list

Screen Shot 2023-01-15 at 10.43.30 PM.png

2.  "Explode" the list into separate rows

Screen Shot 2023-01-15 at 10.44.07 PM.png

3. Add layer to Insights using the Insights magic command

Screen Shot 2023-01-15 at 11.09.22 PM.png

Now you're able to create the Summary Table

Screen Shot 2023-01-15 at 10.51.58 PM.png


Let me know if this doesn't work for you.


New Contributor III

Can I connect to a notebook in ArcGIS online?  I do not have an enterprise setup for my organization yet.


Thanks for the help!

0 Kudos
Esri Contributor

Two separate options here if you don't have Insights Enterprise setup:

1. Use the scripting console in Insights Desktop instead of Insights Enterprise

2. As you mentioned, the same data process can be done using ArcGIS Notebooks, which is available in ArcGIS Online. Insights doesn't connect directly to ArcGIS Notebooks but you can save your output to your ArcGIS Online org and then consume the output within Insights.