<?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: show 2 variable ranges, hide 3rd in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211612#M10433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Ken.&amp;nbsp; At first I thought you were suggesting combining mine with yours, which seemed redundant, then I figured out your "when" block was all it really needed.&amp;nbsp; Since no "other" is required here (and I like having variables), I finally went with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var Temp = $feature.TmaxC&lt;BR /&gt;var Cold = when(Temp &amp;lt; 5, "Freezing", Temp &amp;lt; 10 , "Near Freezing","")&lt;BR /&gt;return Cold&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2020 19:38:55 GMT</pubDate>
    <dc:creator>JohnBranum</dc:creator>
    <dc:date>2020-11-02T19:38:55Z</dc:date>
    <item>
      <title>Arcade Expression: show 2 variable ranges, hide 3rd</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211608#M10429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;I can't see why this expression for a temperature layer won't work.&amp;nbsp; It's addressing a Field ("&lt;SPAN&gt;$feature.TmaxC")&amp;nbsp;&lt;/SPAN&gt;listing temperature attributes in 5-degree increments from -50 degrees to 30 degrees.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;var Cold = ($feature.TmaxC &amp;lt; 10)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;var Freeze = iif(Cold &amp;lt; 5, "Freezing", "Near Freezing")&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;return Freeze&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;My goal is to limit what's shown to freezing polygons surrounded by near-freezing polygons, and hide any temperatures greater than 10(or 9.9) degrees.&amp;nbsp; What I THINK it's saying is:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;EM&gt;"Cold" is only everything&amp;nbsp;in&amp;nbsp;$feature.TmaxC that's below 10 degrees.&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;EM&gt;"Freeze" is everything in Cold that's less than 5 degrees (so, 0 on down to -50), and we'll call that "Freezing".&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;EM&gt;What's left (anywhere it's 5 degrees) is called "Near Freezing".&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;EM&gt;Now show me the two categories of Freeze.&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;The result in my map is that the entire planet is one category - freezing.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Thanks for any help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2020 21:14:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211608#M10429</guid>
      <dc:creator>JohnBranum</dc:creator>
      <dc:date>2020-10-30T21:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression: show 2 variable ranges, hide 3rd</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211609#M10430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proper noob on the Arcade language,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the When function might be appropriate:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/function-reference/logical_functions/#when" title="https://developers.arcgis.com/arcade/function-reference/logical_functions/#when"&gt;Logical Functions | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;var temp = $feature.TmaxC&lt;BR /&gt;var ranking = When (temp &amp;lt; 5, “Freezing”,&lt;BR /&gt;temp &amp;gt;= 5 &amp;amp;&amp;amp; temp &amp;lt; 10, “Near Freezing”,&lt;BR /&gt;“”)&lt;/DIV&gt;&lt;DIV&gt;return ranking&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I can't test this myself at the moment, but it might give a good steer even if it needs finessing.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Oct 2020 11:28:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211609#M10430</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-10-31T11:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression: show 2 variable ranges, hide 3rd</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211610#M10431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your first line&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; Cold &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TmaxC &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;returns a boolean value (true for all temperatures below 10). So when you test that in your second line&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; Freeze &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;iif&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Cold &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Freezing"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Near Freezing"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it's actually checking whether true (which evaluates as 1) is less than 5, which is true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This syntax will give you all your different categories:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;when&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TmaxC &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Freezing"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
     $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TmaxC &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Near Freezing"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
     $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TmaxC &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Cold"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="string token"&gt;"Other"&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:24:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211610#M10431</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T10:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression: show 2 variable ranges, hide 3rd</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211611#M10432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, David!&amp;nbsp; New at this, so the simple idea of "when" never entered my mind.&lt;/P&gt;&lt;P&gt;Learning in baby steps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 19:22:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211611#M10432</guid>
      <dc:creator>JohnBranum</dc:creator>
      <dc:date>2020-11-02T19:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression: show 2 variable ranges, hide 3rd</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211612#M10433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Ken.&amp;nbsp; At first I thought you were suggesting combining mine with yours, which seemed redundant, then I figured out your "when" block was all it really needed.&amp;nbsp; Since no "other" is required here (and I like having variables), I finally went with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var Temp = $feature.TmaxC&lt;BR /&gt;var Cold = when(Temp &amp;lt; 5, "Freezing", Temp &amp;lt; 10 , "Near Freezing","")&lt;BR /&gt;return Cold&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 19:38:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-show-2-variable-ranges-hide-3rd/m-p/211612#M10433</guid>
      <dc:creator>JohnBranum</dc:creator>
      <dc:date>2020-11-02T19:38:55Z</dc:date>
    </item>
  </channel>
</rss>

