<?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: FeatureSet GroupBy CASE expression in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/featureset-groupby-case-expression/m-p/1405159#M9347</link>
    <description>&lt;P&gt;You're not accounting for leap days. Four years has 1461 days, 12 years has 4383 days, and 40 years has 14610 days.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 13:18:51 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-04-03T13:18:51Z</dc:date>
    <item>
      <title>FeatureSet GroupBy CASE expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/featureset-groupby-case-expression/m-p/1405029#M9344</link>
      <description>&lt;P&gt;I'm trying to write an SQL CASE expression for use within a FeatureSet/GroupBy function. I have a Date field that I'm grabbing using&amp;nbsp;&lt;SPAN&gt;FeatureSetByPortalItem and I want to create a field that just puts the ages in classes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ideally, the dates would be dynamic as well, based on today's date and a defined age.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I'm pretty sure the indentation below is improper, but you get the idea of what I'm trying to achieve.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    {
        name: 'feature_age',
        expression: 'CASE 
                       WHEN date_stat =&amp;gt; 2020 THEN 1
                       ELSE date_stat =&amp;gt; 2012 THEN 2
                       ELSE date_stat =&amp;gt; 1984 THEN 3
                       ELSE date_stat =&amp;gt; 1850 THEN 4
                       ELSE NULL
                      END',
        statistic: 'SUM'
    },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Related to a previous post that I found the solution to:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-dashboards-questions/data-too-big-for-a-featureset-calculation-how-else/m-p/1404223#M9338" target="_blank"&gt;https://community.esri.com/t5/arcgis-dashboards-questions/data-too-big-for-a-featureset-calculation-how-else/m-p/1404223#M9338&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 04:47:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/featureset-groupby-case-expression/m-p/1405029#M9344</guid>
      <dc:creator>BlakeMorrison</dc:creator>
      <dc:date>2024-04-03T04:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSet GroupBy CASE expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/featureset-groupby-case-expression/m-p/1405055#M9345</link>
      <description>&lt;P&gt;For those playing at home, the answer is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    {
        name: 'feature_age',
        expression: 'CASE WHEN @today-date_stat &amp;lt; 1460 THEN 1 WHEN @today-date_stat &amp;lt; 4380 THEN 2 WHEN @today-date_stat &amp;lt; 14600 THEN 3 WHEN @today-date_stat &amp;gt; 14600 THEN 4 ELSE NULL END',
        statistic: 'SUM',
    },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: Number of days is used to calculate the age. Ie. 1460 = 4x365&lt;/P&gt;&lt;P&gt;Note2:&amp;nbsp;@today is a var, outside the GroupBy function, defined as Now()&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 07:31:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/featureset-groupby-case-expression/m-p/1405055#M9345</guid>
      <dc:creator>BlakeMorrison</dc:creator>
      <dc:date>2024-04-03T07:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSet GroupBy CASE expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/featureset-groupby-case-expression/m-p/1405159#M9347</link>
      <description>&lt;P&gt;You're not accounting for leap days. Four years has 1461 days, 12 years has 4383 days, and 40 years has 14610 days.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 13:18:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/featureset-groupby-case-expression/m-p/1405159#M9347</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-04-03T13:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSet GroupBy CASE expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/featureset-groupby-case-expression/m-p/1405534#M9351</link>
      <description>&lt;P&gt;haha&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 00:19:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/featureset-groupby-case-expression/m-p/1405534#M9351</guid>
      <dc:creator>BlakeMorrison</dc:creator>
      <dc:date>2024-04-04T00:19:39Z</dc:date>
    </item>
  </channel>
</rss>

