<?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 If Statement/ When Statement in Arcade in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/if-statement-when-statement-in-arcade/m-p/1008722#M37697</link>
    <description>&lt;P&gt;Hi! I have added several layers to my map but want to change the values to 1-5 rather than having ranges such as 16-134, I have tried:&lt;/P&gt;&lt;P&gt;var density = $layer.Median&lt;BR /&gt;var ranking = When(density &amp;lt;=604 &amp;amp;&amp;amp; density &amp;gt;= 605, '1',&lt;BR /&gt;density &amp;gt;=429 &amp;amp;&amp;amp; density &amp;lt; 1604,'2',&lt;BR /&gt;density &amp;gt;= 278 &amp;amp;&amp;amp; density &amp;lt;= 428, '3',&lt;BR /&gt;density &amp;gt;= 134 &amp;amp;&amp;amp; density &amp;lt;= 278, '4',&lt;BR /&gt;density &amp;lt;16 &amp;amp;&amp;amp; density &amp;gt;= 134, '5', 'na')&lt;/P&gt;&lt;P&gt;but recieve the error "&lt;SPAN&gt;Runtime Error: Cannot call member property on object of this type. Median"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have also tried IIF statements but that also did not work. Any advice? thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 23:10:51 GMT</pubDate>
    <dc:creator>LydiaBarnard</dc:creator>
    <dc:date>2020-12-10T23:10:51Z</dc:date>
    <item>
      <title>If Statement/ When Statement in Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/if-statement-when-statement-in-arcade/m-p/1008722#M37697</link>
      <description>&lt;P&gt;Hi! I have added several layers to my map but want to change the values to 1-5 rather than having ranges such as 16-134, I have tried:&lt;/P&gt;&lt;P&gt;var density = $layer.Median&lt;BR /&gt;var ranking = When(density &amp;lt;=604 &amp;amp;&amp;amp; density &amp;gt;= 605, '1',&lt;BR /&gt;density &amp;gt;=429 &amp;amp;&amp;amp; density &amp;lt; 1604,'2',&lt;BR /&gt;density &amp;gt;= 278 &amp;amp;&amp;amp; density &amp;lt;= 428, '3',&lt;BR /&gt;density &amp;gt;= 134 &amp;amp;&amp;amp; density &amp;lt;= 278, '4',&lt;BR /&gt;density &amp;lt;16 &amp;amp;&amp;amp; density &amp;gt;= 134, '5', 'na')&lt;/P&gt;&lt;P&gt;but recieve the error "&lt;SPAN&gt;Runtime Error: Cannot call member property on object of this type. Median"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have also tried IIF statements but that also did not work. Any advice? thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 23:10:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/if-statement-when-statement-in-arcade/m-p/1008722#M37697</guid>
      <dc:creator>LydiaBarnard</dc:creator>
      <dc:date>2020-12-10T23:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement/ When Statement in Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/if-statement-when-statement-in-arcade/m-p/1008732#M37698</link>
      <description>&lt;P&gt;The error indicates your problem is happening on the first line, so it doesn't really matter what you have after that line.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 23:48:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/if-statement-when-statement-in-arcade/m-p/1008732#M37698</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-12-10T23:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement/ When Statement in Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/if-statement-when-statement-in-arcade/m-p/1013368#M37883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/429440"&gt;@LydiaBarnard&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp; mentioned, the problem is with using the median on a layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From your question I am deducing that you want to change the symbology. Is that correct? If so, you don't have access to the $layer and the $layer does not have a median. For symbology, you only have access to the current feature and not all the features in the layer.&lt;/P&gt;&lt;P&gt;In the pop-up you can access the layer and do statistics on the layer, but there is no Median function. There is a Mean function:&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/math_functions/#mean" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/math_functions/#mean&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2021 22:52:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/if-statement-when-statement-in-arcade/m-p/1013368#M37883</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-01-01T22:52:53Z</dc:date>
    </item>
  </channel>
</rss>

