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:
ID | ListAttribute |
1 | a, c |
2 | a, c, d |
3 | a, 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:
value | count |
a | 3 |
b | 1 |
c | 3 |
d | 2 |
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.
Thanks!
@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
2. "Explode" the list into separate rows
3. Add layer to Insights using the Insights magic command
Now you're able to create the Summary Table
Let me know if this doesn't work for you.
Scott
Can I connect to a notebook in ArcGIS online? I do not have an enterprise setup for my organization yet.
Thanks for the help!
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.