<?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 Indicator Widget - ArcGIS Arcade expression to calculate a ratio increase/decrease between 2 Dates in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1150121#M5921</link>
    <description>&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Hello,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I hope someone can help since I am struggling with Date filter in an Arcade expression.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;It is about Covid incidence and I need this for my work.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I would like to have an Indicator that shows me if the Incidence of the most recent record (DayZero) has increase or decreas, compared to the day prior of the most recent record (DayOne). I don´t use&amp;nbsp;&lt;EM&gt;today&lt;/EM&gt; and &lt;EM&gt;yesterday&lt;/EM&gt; becasue the incidence is not always daily acutlized.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I am also not sure when I am suppossed to use '' or "" to reference fields (feature field and arcade dictionaries fields) in my expressions.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Let´s suppose my table looks like this:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;TABLE border="0" width="288" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="96" height="21"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;ObjID&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="96"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;reportdate&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="96"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;incidence&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;56&lt;/TD&gt;&lt;TD&gt;03.03.2022&lt;/TD&gt;&lt;TD&gt;1152,4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;55&lt;/TD&gt;&lt;TD&gt;01.03.2022&lt;/TD&gt;&lt;TD&gt;1428,66&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;54&lt;/TD&gt;&lt;TD&gt;28.02.2022&lt;/TD&gt;&lt;TD&gt;1527,78&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;53&lt;/TD&gt;&lt;TD&gt;27.02.2022&lt;/TD&gt;&lt;TD&gt;1513,9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I tried the method shown here(&lt;A href="https://www.esri.com/arcgis-blog/products/ops-dashboard/announcements/introducing-data-expressions-in-arcgis-dashboards/" target="_blank" rel="noopener"&gt;Introducing Data Expressions in ArcGIS Dashboards (esri.com)&lt;/A&gt;) but it doesnt work. Any ideas pleas? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I thank you so much in advance!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DoZ_0-1646307211272.png" style="width: 789px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35477i95D766FE1ACE87E7/image-dimensions/789x297?v=v2" width="789" height="297" role="button" title="DoZ_0-1646307211272.png" alt="DoZ_0-1646307211272.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DoZ_0-1646308711022.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35478i4DAFAA20DDB8BA29/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DoZ_0-1646308711022.png" alt="DoZ_0-1646308711022.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Code is he&lt;/STRONG&gt;&lt;STRONG&gt;re:&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var fs = FeatureSetByPortalItem(Portal('&lt;A href="https://www.arcgis.com" target="_blank" rel="noopener"&gt;https://www.arcgis.com&lt;/A&gt;'),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;'xxx' , 0, ['incidence','reportdate'], false)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Filter the dataset to only have the most recent date.&lt;BR /&gt;var day_zero = Date(Max(fs,"reportdate"))&lt;BR /&gt;var day_zero_filter = Filter(fs, "reportdate = @day_zero")&lt;/P&gt;&lt;P&gt;// Filter the dataset to only have the day before the most recent date&lt;BR /&gt;var day_one = DateAdd(Date(Max(fs, 'reportdate')), -1, 'days')&lt;BR /&gt;var day_one_filter = Filter(fs, 'reportdate &amp;lt; @day_zero')&lt;/P&gt;&lt;P&gt;// Dictionary to hold ratio rounded with 2 decimals.&lt;BR /&gt;var ratioDict = {&lt;BR /&gt;'fields':&lt;BR /&gt;[{ 'name': 'ratio',&lt;BR /&gt;'type': 'esriFieldTypeDouble'&lt;BR /&gt;}],&lt;BR /&gt;'geometryType': '',&lt;BR /&gt;'features':&lt;BR /&gt;[{'attributes':&lt;BR /&gt;{'ratio': Round((Max(day_zero_filter ,'incidence') - Max(day_one_filter,'incidence')/Max(day_zero_filter ,'incidence'))*100,2),&lt;BR /&gt;}}]};&lt;/P&gt;&lt;P&gt;// Return dictionary as a featureSet.&lt;BR /&gt;return FeatureSet(Text(ratioDict));&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2022 11:58:46 GMT</pubDate>
    <dc:creator>DoZ</dc:creator>
    <dc:date>2022-03-03T11:58:46Z</dc:date>
    <item>
      <title>Indicator Widget - ArcGIS Arcade expression to calculate a ratio increase/decrease between 2 Dates</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1150121#M5921</link>
      <description>&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Hello,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I hope someone can help since I am struggling with Date filter in an Arcade expression.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;It is about Covid incidence and I need this for my work.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I would like to have an Indicator that shows me if the Incidence of the most recent record (DayZero) has increase or decreas, compared to the day prior of the most recent record (DayOne). I don´t use&amp;nbsp;&lt;EM&gt;today&lt;/EM&gt; and &lt;EM&gt;yesterday&lt;/EM&gt; becasue the incidence is not always daily acutlized.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I am also not sure when I am suppossed to use '' or "" to reference fields (feature field and arcade dictionaries fields) in my expressions.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Let´s suppose my table looks like this:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;TABLE border="0" width="288" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="96" height="21"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;ObjID&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="96"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;reportdate&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="96"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;incidence&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;56&lt;/TD&gt;&lt;TD&gt;03.03.2022&lt;/TD&gt;&lt;TD&gt;1152,4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;55&lt;/TD&gt;&lt;TD&gt;01.03.2022&lt;/TD&gt;&lt;TD&gt;1428,66&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;54&lt;/TD&gt;&lt;TD&gt;28.02.2022&lt;/TD&gt;&lt;TD&gt;1527,78&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;53&lt;/TD&gt;&lt;TD&gt;27.02.2022&lt;/TD&gt;&lt;TD&gt;1513,9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I tried the method shown here(&lt;A href="https://www.esri.com/arcgis-blog/products/ops-dashboard/announcements/introducing-data-expressions-in-arcgis-dashboards/" target="_blank" rel="noopener"&gt;Introducing Data Expressions in ArcGIS Dashboards (esri.com)&lt;/A&gt;) but it doesnt work. Any ideas pleas? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;I thank you so much in advance!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DoZ_0-1646307211272.png" style="width: 789px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35477i95D766FE1ACE87E7/image-dimensions/789x297?v=v2" width="789" height="297" role="button" title="DoZ_0-1646307211272.png" alt="DoZ_0-1646307211272.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DoZ_0-1646308711022.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35478i4DAFAA20DDB8BA29/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DoZ_0-1646308711022.png" alt="DoZ_0-1646308711022.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Code is he&lt;/STRONG&gt;&lt;STRONG&gt;re:&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var fs = FeatureSetByPortalItem(Portal('&lt;A href="https://www.arcgis.com" target="_blank" rel="noopener"&gt;https://www.arcgis.com&lt;/A&gt;'),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;'xxx' , 0, ['incidence','reportdate'], false)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Filter the dataset to only have the most recent date.&lt;BR /&gt;var day_zero = Date(Max(fs,"reportdate"))&lt;BR /&gt;var day_zero_filter = Filter(fs, "reportdate = @day_zero")&lt;/P&gt;&lt;P&gt;// Filter the dataset to only have the day before the most recent date&lt;BR /&gt;var day_one = DateAdd(Date(Max(fs, 'reportdate')), -1, 'days')&lt;BR /&gt;var day_one_filter = Filter(fs, 'reportdate &amp;lt; @day_zero')&lt;/P&gt;&lt;P&gt;// Dictionary to hold ratio rounded with 2 decimals.&lt;BR /&gt;var ratioDict = {&lt;BR /&gt;'fields':&lt;BR /&gt;[{ 'name': 'ratio',&lt;BR /&gt;'type': 'esriFieldTypeDouble'&lt;BR /&gt;}],&lt;BR /&gt;'geometryType': '',&lt;BR /&gt;'features':&lt;BR /&gt;[{'attributes':&lt;BR /&gt;{'ratio': Round((Max(day_zero_filter ,'incidence') - Max(day_one_filter,'incidence')/Max(day_zero_filter ,'incidence'))*100,2),&lt;BR /&gt;}}]};&lt;/P&gt;&lt;P&gt;// Return dictionary as a featureSet.&lt;BR /&gt;return FeatureSet(Text(ratioDict));&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 11:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1150121#M5921</guid>
      <dc:creator>DoZ</dc:creator>
      <dc:date>2022-03-03T11:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Indicator Widget - ArcGIS Arcade expression to calculate a ratio increase/decrease between 2 Dates</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1150158#M5922</link>
      <description>&lt;P&gt;Hard to say without access to the data, but it may be easier to diagnose if we do more of the work outside of the ratioDict. That way you can pass any of your variables to the Console and check their outputs.&lt;/P&gt;&lt;P&gt;Also, don't forget about the order of operations! They way you've written this, the expression will evaluate the division &lt;EM&gt;before &lt;/EM&gt;the subtraction, and won't give you the results you want. But it's hard to see that with all the parentheses in a single line.&lt;/P&gt;&lt;P&gt;Another point: while you can use the "@var" method to pip variables in to your filter statement, I personally prefer using backtick strings, where &lt;EM&gt;anything &lt;/EM&gt;can be piped in inside of a ${ }. This means you don't need to establish temporary variables for a single use, you just use those values right when you need them.&lt;/P&gt;&lt;P&gt;Finally, the indicator itself has formatting options built in. Just worry about getting the number out, then format it as needed in the indicator.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fs = FeatureSetByPortalItem(
    Portal('https://www.arcgis.com'),
    'xxx',
    0,
    ['incidence','reportdate'],
    false
)


// Filter the dataset to only have the most recent date.
var day_zero_filter = Filter(fs, `reportdate = ${Date(Max(fs,"reportdate"))}`)

// Filter the dataset to only have the day before the most recent date
var day_one_filter = Filter(fs, `reportdate &amp;lt; ${DateAdd(Date(Max(fs, 'reportdate')), -1, 'days')}`)

// Construct the ratio
var zero_incidence = Max(day_zero_filter, 'incidence')
var one_incidence = Max(day_one_filter, 'incidence')

var ratio = (zero_incidence - one_incidence) / zero_incidence

// Dictionary to hold ratio rounded with 2 decimals.
var ratioDict = {
    fields: [{name: 'ratio', type: 'esriFieldTypeDouble'}],
    geometryType: '',
    features: [{attributes: {ratio: ratio}}]
}

// Return dictionary as a featureSet.
return FeatureSet(Text(ratioDict));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 14:08:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1150158#M5922</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-03T14:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Indicator Widget - ArcGIS Arcade expression to calculate a ratio increase/decrease between 2 Dates</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1150167#M5923</link>
      <description>&lt;P&gt;Hi Carlson,&lt;/P&gt;&lt;P&gt;thnaks for your prompt response. I just was trying to taste the single variables and found this problem:&lt;/P&gt;&lt;P&gt;when I use the &lt;STRONG&gt;=&lt;/STRONG&gt; sign before the &lt;STRONG&gt;@d&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;ay_filte&lt;/STRONG&gt;r it gives me an empty result (&lt;STRONG&gt;IMG1&lt;/STRONG&gt;). But the if I use &lt;STRONG&gt;&amp;gt;&lt;/STRONG&gt; or even &lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt; it gives me a correct result (&lt;STRONG&gt;IMG2&lt;/STRONG&gt;). It is so frustrating!! I also tried == but went worse ...(&lt;STRONG&gt;IMG3&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;IMG 1&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DoZ_1-1646316969242.png" style="width: 552px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35484i5F5E93868F37FFF2/image-dimensions/552x406?v=v2" width="552" height="406" role="button" title="DoZ_1-1646316969242.png" alt="DoZ_1-1646316969242.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;IMG2&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DoZ_0-1646316899682.png" style="width: 561px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35483iF79B971B6970A251/image-dimensions/561x369?v=v2" width="561" height="369" role="button" title="DoZ_0-1646316899682.png" alt="DoZ_0-1646316899682.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IMG 3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DoZ_2-1646317060760.png" style="width: 554px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35485i43E15F41E444356E/image-dimensions/554x324?v=v2" width="554" height="324" role="button" title="DoZ_2-1646317060760.png" alt="DoZ_2-1646317060760.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will now try out your solution...! I will let you know!&lt;/P&gt;&lt;P&gt;thanks a lot!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 14:18:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1150167#M5923</guid>
      <dc:creator>DoZ</dc:creator>
      <dc:date>2022-03-03T14:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Indicator Widget - ArcGIS Arcade expression to calculate a ratio increase/decrease between 2 Dates</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1150200#M5926</link>
      <description>&lt;P&gt;Hey hi!&lt;/P&gt;&lt;P&gt;I guess I am doing something wrong because the script doesn´t work, and&amp;nbsp; if I only try the &lt;STRONG&gt;Return&lt;/STRONG&gt; of first sentence (&lt;STRONG&gt;var day_zero_filter&lt;/STRONG&gt;) it also gives me an error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DoZ_0-1646319074277.png" style="width: 675px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35490iD04B1748E65263E0/image-dimensions/675x471?v=v2" width="675" height="471" role="button" title="DoZ_0-1646319074277.png" alt="DoZ_0-1646319074277.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas...? Cheers!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 15:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1150200#M5926</guid>
      <dc:creator>DoZ</dc:creator>
      <dc:date>2022-03-03T15:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Indicator Widget - ArcGIS Arcade expression to calculate a ratio increase/decrease between 2 Dates</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1151215#M5941</link>
      <description>&lt;P&gt;Hello Everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I post here the soloution/workaround I found. I actually enden up using the Today(), becuase only with this one the = functioned.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DoZ_0-1646657128981.png" style="width: 654px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35739i640438722066A130/image-dimensions/654x585?v=v2" width="654" height="585" role="button" title="DoZ_0-1646657128981.png" alt="DoZ_0-1646657128981.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var fs = FeatureSetByPortalItem(Portal('&lt;A href="https://www.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;'),&lt;BR /&gt;'xxxxx' , 0, ['incidence','reportdate'], false)&lt;/P&gt;&lt;P&gt;// Filter the dataset to only have the past 2 days.&lt;BR /&gt;var day_zero = DateAdd(Today(), -1, 'days')&lt;BR /&gt;var day_zero _filter = Filter(fs, "reportdate = @day_zero")&lt;BR /&gt;var day_one = DateAdd(Today(), -2, 'days')&lt;BR /&gt;var day_one_filter = Filter(fs, 'reportdate = @day_one')&lt;/P&gt;&lt;P&gt;// Dictionary to hold data.&lt;BR /&gt;var ratioDict = {&lt;BR /&gt;'fields':&lt;BR /&gt;[{ 'name': 'ratio',&lt;BR /&gt;'type': 'esriFieldTypeDouble'&lt;BR /&gt;}],&lt;BR /&gt;'geometryType': '',&lt;BR /&gt;'features':&lt;BR /&gt;[{'attributes':&lt;BR /&gt;{'ratio': Round(((Max(day_zero ,'incidence') - Max(day_one,'incidence'))/Max(day_zero ,'incidence'))*100,2),&lt;BR /&gt;}}]};&lt;BR /&gt;// Return dictionary as a featureSet.&lt;BR /&gt;return FeatureSet(Text(ratioDict));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 12:47:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/indicator-widget-arcgis-arcade-expression-to/m-p/1151215#M5941</guid>
      <dc:creator>DoZ</dc:creator>
      <dc:date>2022-03-07T12:47:32Z</dc:date>
    </item>
  </channel>
</rss>

