<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Arcade Expression for Separating &amp;quot;Multiple Choice&amp;quot; responses in Serial Chart in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1129633#M5589</link>
    <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a dashboard that reports the activities of stakeholders, using data from Survey123, and my client is asking for more dynamic graphs. My problem is with the Multiple Choice responses using Survey123. I want to graph each response option category separately, with the number of responses for each category, but with the built-in options, the graphs (serial and pie chart) produce a unique category for each of the 64 stakeholder responses with the multiple choices separated by commas. I've attached a photo of what this looks like, as well as what I want the graph to look like, as it does in Survey123's "Analyze" tab.&lt;/P&gt;&lt;P&gt;It sounds like I need to use Arcade for this. I found a link to an example expression in a separate post and gave it a try:&amp;nbsp;&lt;A href="https://github.com/Esri/arcade-expressions/blob/master/dashboard_data/SplitCategories(PieChart).md" target="_blank"&gt;https://github.com/Esri/arcade-expressions/blob/master/dashboard_data/SplitCategories(PieChart).md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I changed the code to this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Reference layer using the FeatureSetByPortalItem() method.&lt;BR /&gt;var portal = Portal('&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;')&lt;BR /&gt;var fs = FeatureSetByPortalItem(&lt;BR /&gt;portal,&lt;BR /&gt;'4a4974e1b74a45b2bbfc48d95c431e88',&lt;BR /&gt;0,&lt;BR /&gt;['GEO_focus'],&lt;BR /&gt;false&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;// Empty dictionary to capture each choice reported as separate rows.&lt;BR /&gt;var choicesDict = {'fields': [{ 'name': 'split_choices', 'type': 'esriFieldTypeString'}],&lt;BR /&gt;'geometryType': '', 'features': []};&lt;/P&gt;&lt;P&gt;var index = 0;&lt;/P&gt;&lt;P&gt;// Split comma separated choices and store in dictionary.&lt;BR /&gt;for (var feature in fs) {&lt;BR /&gt;var split_array = Split(feature["GEO_focus"], ',')&lt;BR /&gt;var count_arr = Count(split_array)&lt;BR /&gt;for(var i = 0; i &amp;lt; count_arr; i++ ){&lt;BR /&gt;choicesDict.features[index++] = {&lt;BR /&gt;'attributes': { 'split_choices': Trim(split_array[i]),&lt;BR /&gt;}&lt;BR /&gt;}}}&lt;/P&gt;&lt;P&gt;// Convert dictionary to featureSet.&lt;BR /&gt;var fs_dict = FeatureSet(Text(choicesDict));&lt;/P&gt;&lt;P&gt;// Return featureset after grouping by hazard types.&lt;BR /&gt;return GroupBy(fs_dict, ['split_choices'],&lt;BR /&gt;[{ name: 'split_count', expression: 'split_choices', statistic: 'COUNT' }]);&lt;/P&gt;&lt;P&gt;What I want is for the ecosystem types to appear on the x axis with the counts on the y axis. I've attached photos for what this expression translates into in graphic form in the dashboard. I'm not a programmer, so any help would be very much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/434315"&gt;@XavierBustos&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Dec 2021 13:24:43 GMT</pubDate>
    <dc:creator>AmberKremer</dc:creator>
    <dc:date>2021-12-30T13:24:43Z</dc:date>
    <item>
      <title>Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1129633#M5589</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a dashboard that reports the activities of stakeholders, using data from Survey123, and my client is asking for more dynamic graphs. My problem is with the Multiple Choice responses using Survey123. I want to graph each response option category separately, with the number of responses for each category, but with the built-in options, the graphs (serial and pie chart) produce a unique category for each of the 64 stakeholder responses with the multiple choices separated by commas. I've attached a photo of what this looks like, as well as what I want the graph to look like, as it does in Survey123's "Analyze" tab.&lt;/P&gt;&lt;P&gt;It sounds like I need to use Arcade for this. I found a link to an example expression in a separate post and gave it a try:&amp;nbsp;&lt;A href="https://github.com/Esri/arcade-expressions/blob/master/dashboard_data/SplitCategories(PieChart).md" target="_blank"&gt;https://github.com/Esri/arcade-expressions/blob/master/dashboard_data/SplitCategories(PieChart).md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I changed the code to this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Reference layer using the FeatureSetByPortalItem() method.&lt;BR /&gt;var portal = Portal('&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;')&lt;BR /&gt;var fs = FeatureSetByPortalItem(&lt;BR /&gt;portal,&lt;BR /&gt;'4a4974e1b74a45b2bbfc48d95c431e88',&lt;BR /&gt;0,&lt;BR /&gt;['GEO_focus'],&lt;BR /&gt;false&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;// Empty dictionary to capture each choice reported as separate rows.&lt;BR /&gt;var choicesDict = {'fields': [{ 'name': 'split_choices', 'type': 'esriFieldTypeString'}],&lt;BR /&gt;'geometryType': '', 'features': []};&lt;/P&gt;&lt;P&gt;var index = 0;&lt;/P&gt;&lt;P&gt;// Split comma separated choices and store in dictionary.&lt;BR /&gt;for (var feature in fs) {&lt;BR /&gt;var split_array = Split(feature["GEO_focus"], ',')&lt;BR /&gt;var count_arr = Count(split_array)&lt;BR /&gt;for(var i = 0; i &amp;lt; count_arr; i++ ){&lt;BR /&gt;choicesDict.features[index++] = {&lt;BR /&gt;'attributes': { 'split_choices': Trim(split_array[i]),&lt;BR /&gt;}&lt;BR /&gt;}}}&lt;/P&gt;&lt;P&gt;// Convert dictionary to featureSet.&lt;BR /&gt;var fs_dict = FeatureSet(Text(choicesDict));&lt;/P&gt;&lt;P&gt;// Return featureset after grouping by hazard types.&lt;BR /&gt;return GroupBy(fs_dict, ['split_choices'],&lt;BR /&gt;[{ name: 'split_count', expression: 'split_choices', statistic: 'COUNT' }]);&lt;/P&gt;&lt;P&gt;What I want is for the ecosystem types to appear on the x axis with the counts on the y axis. I've attached photos for what this expression translates into in graphic form in the dashboard. I'm not a programmer, so any help would be very much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/434315"&gt;@XavierBustos&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 13:24:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1129633#M5589</guid>
      <dc:creator>AmberKremer</dc:creator>
      <dc:date>2021-12-30T13:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1129640#M5590</link>
      <description>&lt;P&gt;You're really 99% of the way there. The issue is with the chart configuration, not the expression.&lt;/P&gt;&lt;P&gt;When you set a chart to &lt;STRONG&gt;Grouped Values&lt;/STRONG&gt; and use the statistic &lt;STRONG&gt;Count&lt;/STRONG&gt;, it's counting the number of &lt;EM&gt;rows&lt;/EM&gt; in the data table per category. Since your rows are already grouped together by the final &lt;STRONG&gt;GroupBy&lt;/STRONG&gt; function in your expression, that gives you 1 for each category.&lt;/P&gt;&lt;P&gt;What you need to do is set the statistic to &lt;STRONG&gt;Sum&lt;/STRONG&gt;, and it will give you to total &lt;EM&gt;value&lt;/EM&gt; of the grouped field, as opposed to the number of rows.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 14:21:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1129640#M5590</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-30T14:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1129641#M5591</link>
      <description>&lt;P&gt;Hi Josh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't thank you enough for your help! Another quick question: The "split_count" would be the total count for each of the choices or categories, and would be used for "field", correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 14:38:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1129641#M5591</guid>
      <dc:creator>AmberKremer</dc:creator>
      <dc:date>2021-12-30T14:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1129650#M5594</link>
      <description>&lt;P&gt;Yes, "split_count" is your field that you're summing.&lt;/P&gt;&lt;P&gt;You're welcome!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 15:40:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1129650#M5594</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-30T15:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1256892#M7332</link>
      <description>&lt;P&gt;Is there a way to do this and break the results down further based on other data?&lt;/P&gt;&lt;P&gt;I am have audit data from survey 123 and this has been great for breaking down the multiple field data but I now want to be able to filter it based on a few other fields.&lt;/P&gt;&lt;P&gt;is this possible?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 07:35:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1256892#M7332</guid>
      <dc:creator>tendtreesTC</dc:creator>
      <dc:date>2023-02-10T07:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1285819#M7752</link>
      <description>&lt;P&gt;Hi! I was having the same issue.&amp;nbsp; I can create the serial chart, but I want to be able to further filter it based on other widgets on my dashboard.&amp;nbsp; I Suspect I would have to add more fields to the return array.&amp;nbsp; Have you been able to figure this out?&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 18:53:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1285819#M7752</guid>
      <dc:creator>BNix_TPA</dc:creator>
      <dc:date>2023-05-04T18:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1306940#M8058</link>
      <description>&lt;P&gt;I am trying to do the same! Let me know if you ever figured it out, please.&lt;/P&gt;&lt;P&gt;The split_count arcade worked great for my serial chart, but now I want it to filter other charts. Hoping there is an arcade solution to also create an array/list using GUID or something.&lt;/P&gt;&lt;P&gt;I have days of the week broken into the split_choices. Hoping to click "Friday" on the serial chart and filter features that contain that value.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 14:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1306940#M8058</guid>
      <dc:creator>Symbology2008</dc:creator>
      <dc:date>2023-07-10T14:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1390500#M9197</link>
      <description>&lt;P&gt;This thread has some helpful code samples&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-dashboards-questions/arcade-split-comma-delimited-value-into-multiple/m-p/1105537" target="_blank"&gt;https://community.esri.com/t5/arcgis-dashboards-questions/arcade-split-comma-delimited-value-into-multiple/m-p/1105537&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 16:42:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1390500#M9197</guid>
      <dc:creator>ArielLow2146</dc:creator>
      <dc:date>2024-03-04T16:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1476174#M9612</link>
      <description>&lt;P&gt;Hello! Thank you for the solution.&lt;/P&gt;&lt;P&gt;But I do not understand how I can do it! can you please assist me step by step?&lt;/P&gt;&lt;P&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 11:38:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1476174#M9612</guid>
      <dc:creator>IbrahimZahra</dc:creator>
      <dc:date>2024-05-21T11:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for Separating "Multiple Choice" responses in Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1476194#M9614</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Thank you for the solution, but I do not know how to do that, can you please show me step by step?&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 12:13:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-separating-quot-multiple/m-p/1476194#M9614</guid>
      <dc:creator>IbrahimZahra</dc:creator>
      <dc:date>2024-05-21T12:13:25Z</dc:date>
    </item>
  </channel>
</rss>

