<?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: Condition--Result Case statement syntax using Arcade in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316810#M8242</link>
    <description>&lt;P&gt;Thank you for the help and yeah, I definitely need to look at those operators I was trying to hack something together after work and was kind of out of patience at that point. I appreciate your help!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Aug 2023 12:01:08 GMT</pubDate>
    <dc:creator>MPach</dc:creator>
    <dc:date>2023-08-09T12:01:08Z</dc:date>
    <item>
      <title>Condition--Result Case statement syntax using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316703#M8229</link>
      <description>&lt;P&gt;I'm trying to essentially write an If...Then...Else statement using Arcade to change the text color in a Dashboard Indicator. I know what I need to do I just don't know the proper syntax for writing it and I'm having a problem finding a similar example.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var color = ''   // using the var to change the color attribute

Decode($datapoint["capdep25"],     //attempting to using the "capdep25" column
  &amp;lt;=.25, {color = 'DF73FF'},      //if value is less than .25 make it pink 
  &amp;gt;.25 AND &amp;lt;=.50 , {color = '0070FF'}, //if value is between than make it blue
  &amp;gt;.50 AND &amp;lt;=.75, {color = '38A800'}, //if value is between than make it green
  &amp;gt;.75, {color = 'E60000'}, 0    //if value is greater than make it red
 );&lt;/LI-CODE&gt;&lt;P&gt;I'm not sure if decode is the correct way to do this or there is a better way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 00:34:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316703#M8229</guid>
      <dc:creator>MPach</dc:creator>
      <dc:date>2023-08-09T00:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Condition--Result Case statement syntax using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316784#M8238</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/logical_functions/#decode" target="_blank" rel="noopener"&gt;Decode()&lt;/A&gt;&amp;nbsp;is a switch/case statement, it matches the values exactly. You want&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/logical_functions/#when" target="_blank" rel="noopener"&gt;When()&lt;/A&gt;&amp;nbsp;, which is a nested if/else.&lt;/P&gt;&lt;P&gt;Also, take a look at the &lt;A href="https://developers.arcgis.com/arcade/guide/operators/#logical-operators" target="_blank" rel="noopener"&gt;logical operators&lt;/A&gt;.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var cd25 = $datapoint["capdep25"

var color = When(
    cd25 &amp;lt;= 0.25, "DE73FF",
    cd25 &amp;gt; 0.25 &amp;amp;&amp;amp; cd25 &amp;lt;= 0.5, "0070FF",
    cd25 &amp;gt; 0.5 &amp;amp;&amp;amp; cd25 &amp;lt;= 0.75, "38A800",
    "E60000"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 10:45:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316784#M8238</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-08-09T10:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Condition--Result Case statement syntax using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316810#M8242</link>
      <description>&lt;P&gt;Thank you for the help and yeah, I definitely need to look at those operators I was trying to hack something together after work and was kind of out of patience at that point. I appreciate your help!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 12:01:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316810#M8242</guid>
      <dc:creator>MPach</dc:creator>
      <dc:date>2023-08-09T12:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Condition--Result Case statement syntax using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316821#M8246</link>
      <description>&lt;P&gt;Ok, this time I'm at a loss. My indicator text is coming up black now for all values. I'm assuming it has to by that my statement logic is somehow incorrect, but it seems fine to me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var cd25 = $datapoint["capdep25"];

var color = When(
    cd25 &amp;gt; .001 &amp;amp;&amp;amp; cd25 &amp;lt;= 0.25, "DE73FF",                 //pink
    cd25 &amp;gt; .25 &amp;amp;&amp;amp; cd25 &amp;lt;= 0.5, "0070FF",                   //blue
    cd25 &amp;gt; 0.5 &amp;amp;&amp;amp; cd25 &amp;lt;= 0.75, "38A800",                 //green
    "E60000"                                              //red
);&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MPach_0-1691584667924.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/77646i6922D7A4EF71408F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MPach_0-1691584667924.png" alt="MPach_0-1691584667924.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 12:38:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316821#M8246</guid>
      <dc:creator>MPach</dc:creator>
      <dc:date>2023-08-09T12:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Condition--Result Case statement syntax using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316866#M8249</link>
      <description>&lt;P&gt;You need to include the "#" in your color codes. And you can make your code a little simpler&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var cd25 = $datapoint["capdep25"];

var color = When(
    cd25 &amp;gt; .001 &amp;amp;&amp;amp; cd25 &amp;lt;= 0.25, "#DE73FF",   //pink
    cd25 &amp;lt;= 0.5, "#0070FF",                   //blue
    cd25 &amp;lt;= 0.75, "#38A800",                  //green
    "#E60000"                                 //red
);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 09 Aug 2023 14:05:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316866#M8249</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-08-09T14:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Condition--Result Case statement syntax using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316870#M8251</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;. That's why my profile pic is the rolling eye emoji. It's usually something silly I'm missing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 14:20:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/condition-result-case-statement-syntax-using/m-p/1316870#M8251</guid>
      <dc:creator>MPach</dc:creator>
      <dc:date>2023-08-09T14:20:32Z</dc:date>
    </item>
  </channel>
</rss>

