<?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 Re: Arcade Expression to summarize values in text string in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1287060#M52037</link>
    <description>&lt;P&gt;You're printing out Ucode which is just the most recent decoded value, replace "Ucode" with "d" in the out_str line to print out the relevant dictionary key.&lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2023 22:51:59 GMT</pubDate>
    <dc:creator>JoshuaSharp-Heward</dc:creator>
    <dc:date>2023-05-08T22:51:59Z</dc:date>
    <item>
      <title>Arcade Expression to summarize values in text string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1285281#M51893</link>
      <description>&lt;P&gt;I have an arcade expression for a popup that returns a text string comprised of a land use description and a length. How would I go about summarizing the total length by the land use description?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;buffer&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;BufferGeodetic&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;50&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"feet"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;int_ma&lt;/SPAN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&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Multiple-Use, Primarily Residential"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"031"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Multiple-Use, Primarily Commercial"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"101"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Residential, Single Family"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"102"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Residential, Multi-family"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"1320"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Residential, Vacant Land"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"140"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Residential, Other"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"300"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Commercial"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"3000"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Commercial"&lt;/SPA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t;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)+&lt;/SPAN&gt;&lt;SPAN&gt;" Ft"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;out_str&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Output.png" style="width: 589px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69771i90C972FFA0AA4FEE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Output.png" alt="Output.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 16:59:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1285281#M51893</guid>
      <dc:creator>AustinCanty1</dc:creator>
      <dc:date>2023-05-03T16:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to summarize values in text string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1285502#M51920</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm a little confused because the screenshot and your code above don't match - I'm guessing the problem is because there are multiple codes linked to one land use description (e.g. '0101' and '0102' for "Multiple-Use, Primarily Residential") so they're not being aggregated? If you use your "decode" before you write the key to the int_dict variable that should group it all correctly (i.e. using "Multiple-Use, Primarily Residental" use the key instead of the code). Otherwise it all looks good to me.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 02:48:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1285502#M51920</guid>
      <dc:creator>JoshuaSharp-Heward</dc:creator>
      <dc:date>2023-05-04T02:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to summarize values in text string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1285931#M51954</link>
      <description>&lt;P&gt;To post code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1677736512957.png" style="width: 546px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64138iBB0E7839D9513E0F/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1677736512957.png" alt="JohannesLindner_0-1677736512957.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1677736529803.png" style="width: 661px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64139i1EE5AE3E3AEE8247/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_1-1677736529803.png" alt="JohannesLindner_1-1677736529803.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wow, I searched and searched for an error, because your expression returned the correct result (except for that "0" at the start). But you actually have multiple codes for the same land use...&lt;/P&gt;&lt;P&gt;So you need to summarize by the actual land use, not the code. Do the decoding in the loop where you fill int_dict.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 22:30:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1285931#M51954</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-05-04T22:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to summarize values in text string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1286130#M51968</link>
      <description>&lt;P&gt;Thanks! That makes sense, but I'm having trouble getting that to work. I moved the decode up into the first loop but now everything is returning as "Other". Do I have to change something with the HasKey?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var buffer = BufferGeodetic($feature, 50, "feet")
var int_ma = Intersects(FeatureSetByName($map, "AllParcels"), BufferGeodetic($feature, 50, "feet"))
var leng = LengthGeodetic($feature, 'feet')

var int_dict = {}
var xs = ""
for (var i in int_ma){
  var Ucode = decode(i,
  "0101", "Multiple-Use, Primarily Residential",
  "0102", "Multiple-Use, Primarily Residential",
  "0104", "Multiple-Use, Primarily Residential",
  "031", "Multiple-Use, Primarily Commercial",
  "0316", "Multiple-Use, Primarily Commercial",
  "0321", "Multiple-Use, Primarily Commercial",
  "101", "Residential, Single Family",
  "1010", "Residential, Single Family",
  "1014", "Residential, Multi-family",
  "102", "Residential, Multi-family",
  "130", "Residential, Vacant Land",
  "300", "Commercial",
  "3000", "Commercial",
  "302", "Commercial",
  "400", "Industrial",
  "4000", "Industrial",
  "901", "Exempt Property",
  "902", "Exempt Property",
  'other');
    var xs = AreaGeodetic(Intersection(buffer, i), 'square-feet')
    if(HasKey(int_dict,i.USE_CODE)){
        int_dict[i.USE_CODE] += xs
    } else {
        int_dict[i.USE_CODE] = xs
    }
var total = 0
var out_str = ''
for (var t in int_dict){
    total += sum(number(int_dict[t]))
}

for (var d in int_dict){
  out_str += '\n' +  Ucode + ' - ' +round(number(int_dict[d])/(total)*leng,2)+" Ft"
}}

return out_str&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 14:46:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1286130#M51968</guid>
      <dc:creator>AustinCanty1</dc:creator>
      <dc:date>2023-05-05T14:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to summarize values in text string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1286422#M52013</link>
      <description>&lt;P&gt;I think you need to change the decode to be decoding i.USE_CODE, as currently it's decoding the feature object itself? And you need to pass that decoded value into your dictionary not the i.USE_CODE, so something like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var buffer = BufferGeodetic($feature, 50, "feet")
var int_ma = Intersects(FeatureSetByName($map, "AllParcels"), BufferGeodetic($feature, 50, "feet"))
var leng = LengthGeodetic($feature, 'feet')

var int_dict = {}
var xs = ""
for (var i in int_ma){
  var Ucode = decode(i.USE_CODE,
  "0101", "Multiple-Use, Primarily Residential",
  "0102", "Multiple-Use, Primarily Residential",
  "0104", "Multiple-Use, Primarily Residential",
  "031", "Multiple-Use, Primarily Commercial",
  "0316", "Multiple-Use, Primarily Commercial",
  "0321", "Multiple-Use, Primarily Commercial",
  "101", "Residential, Single Family",
  "1010", "Residential, Single Family",
  "1014", "Residential, Multi-family",
  "102", "Residential, Multi-family",
  "130", "Residential, Vacant Land",
  "300", "Commercial",
  "3000", "Commercial",
  "302", "Commercial",
  "400", "Industrial",
  "4000", "Industrial",
  "901", "Exempt Property",
  "902", "Exempt Property",
  'other');
    var xs = AreaGeodetic(Intersection(buffer, i), 'square-feet')
    if(HasKey(int_dict,UCode)){
        int_dict[UCode] += xs
    } else {
        int_dict[UCode] = xs
    }
var total = 0
var out_str = ''
for (var t in int_dict){
    total += sum(number(int_dict[t]))
}

for (var d in int_dict){
  out_str += '\n' +  Ucode + ' - ' +round(number(int_dict[d])/(total)*leng,2)+" Ft"
}}

return out_str&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 05 May 2023 22:40:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1286422#M52013</guid>
      <dc:creator>JoshuaSharp-Heward</dc:creator>
      <dc:date>2023-05-05T22:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to summarize values in text string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1286723#M52029</link>
      <description>&lt;P&gt;I've tried that and it seems like it's grouping the use types together properly but not applying the use code descriptions correctly. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Output.png" style="width: 746px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70105iCED62304484EE863/image-size/large?v=v2&amp;amp;px=999" role="button" title="Output.png" alt="Output.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 14:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1286723#M52029</guid>
      <dc:creator>AustinCanty1</dc:creator>
      <dc:date>2023-05-08T14:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to summarize values in text string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1287060#M52037</link>
      <description>&lt;P&gt;You're printing out Ucode which is just the most recent decoded value, replace "Ucode" with "d" in the out_str line to print out the relevant dictionary key.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 22:51:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1287060#M52037</guid>
      <dc:creator>JoshuaSharp-Heward</dc:creator>
      <dc:date>2023-05-08T22:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to summarize values in text string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1287220#M52047</link>
      <description>&lt;P&gt;Ah that's it! Thank you so much for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 13:24:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1287220#M52047</guid>
      <dc:creator>AustinCanty1</dc:creator>
      <dc:date>2023-05-09T13:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to summarize values in text string</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1287425#M52061</link>
      <description>&lt;P&gt;No worries, glad I could help out!&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 19:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-summarize-values-in-text/m-p/1287425#M52061</guid>
      <dc:creator>JoshuaSharp-Heward</dc:creator>
      <dc:date>2023-05-09T19:44:57Z</dc:date>
    </item>
  </channel>
</rss>

