<?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: Date Selector by month in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/date-selector-by-month/m-p/1315076#M8210</link>
    <description>&lt;P&gt;Please upvote this idea I made for this functionality&lt;SPAN&gt;:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-dashboards-ideas/allow-month-or-year-choices-on-date-selector/idi-p/1314770" target="_blank"&gt;https://community.esri.com/t5/arcgis-dashboards-ideas/allow-month-or-year-choices-on-date-selector/idi-p/1314770&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2023 14:59:44 GMT</pubDate>
    <dc:creator>ChelseaRozek</dc:creator>
    <dc:date>2023-08-03T14:59:44Z</dc:date>
    <item>
      <title>Date Selector by month</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/date-selector-by-month/m-p/1199488#M6643</link>
      <description>&lt;P&gt;I have a dashboard displaying seasonal snow data. I want to be able to look at the historical averages by winter and month and calculate % of average.&lt;/P&gt;&lt;P&gt;An indicator can calculate the average per time period based on the date selector, but then I only see the average amount of snow for that specific date range, not over the 30-years of data.&lt;/P&gt;&lt;P&gt;I can define date options for months, but it seems tedious to choose every May for the past 30 years. Is there a way to custom define date ranges more easily?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ryanEvanczyk_0-1659471702520.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47629i89A6D0C747D82118/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ryanEvanczyk_0-1659471702520.png" alt="ryanEvanczyk_0-1659471702520.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 16:56:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/date-selector-by-month/m-p/1199488#M6643</guid>
      <dc:creator>ryanEvanczyk</dc:creator>
      <dc:date>2022-08-04T16:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Date Selector by month</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/date-selector-by-month/m-p/1199501#M6644</link>
      <description>&lt;P&gt;A Data Expression could take care of that for you. If you reshaped the data to have a "month" field separate from its date/time field, you could then use that as a category. We can use one of the functions that utilizes SQL to get that calculated field into our output FeatureSet.&lt;/P&gt;&lt;P&gt;It might look something like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fields = ['fields', 'you', 'need']

var fs = FeatureSetByPortalItem(
    Portal('your portal url'),
    'itemid of service',
    0, // or whatever layer index your specific layer is at
    fields,
    false
)

// convert list of fields into array of dicts that Distinct can use

var field_dicts = []

for (var f in fields){
    Push(
        field_dicts,
        {name: fields[f], expression: fields[f]}
    )
}

// push our calculated date field into array

Push(
    field_dicts,
    {name: 'the_month', expression: 'EXTRACT(MONTH FROM date_field)'}
)

// use field dicts to return featureset with added field
return Distinct(fs, field_dicts)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And just to explain that a bit, the &lt;STRONG&gt;FeatureSetByPortalItem&lt;/STRONG&gt; function takes an array of field names as a parameter. In order to use SQL in &lt;STRONG&gt;Distinct&lt;/STRONG&gt;, however, we need an array of dictionaries with a &lt;STRONG&gt;name &lt;/STRONG&gt;and &lt;STRONG&gt;expression&lt;/STRONG&gt;. If we omit any of our input fields from that array of dictionaries, it will be dropped from the output.&lt;/P&gt;&lt;P&gt;You &lt;EM&gt;could &lt;/EM&gt;just type out the whole array of dicts by hand, but I don't know how many fields you want in your FeatureSet. This method of constructing the array of dicts &lt;EM&gt;from &lt;/EM&gt;the array of field names can accommodate any number of fields listed in the &lt;STRONG&gt;fields&lt;/STRONG&gt; array without any change.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 17:15:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/date-selector-by-month/m-p/1199501#M6644</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-08-04T17:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Date Selector by month</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/date-selector-by-month/m-p/1201046#M6660</link>
      <description>&lt;P&gt;Thanks so much for the response.&lt;/P&gt;&lt;P&gt;Thankfully, we only collect data in the winter and I'm building a new survey for the upcoming season which I'll append the data to when it's ready.&lt;/P&gt;&lt;P&gt;The month column is a great solution. I added that and a snow year column and the new survey has calculation fields to pull those numbers from the datetime field. Now if I can just get the data to append properly....&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 20:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/date-selector-by-month/m-p/1201046#M6660</guid>
      <dc:creator>ryanEvanczyk</dc:creator>
      <dc:date>2022-08-09T20:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date Selector by month</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/date-selector-by-month/m-p/1315076#M8210</link>
      <description>&lt;P&gt;Please upvote this idea I made for this functionality&lt;SPAN&gt;:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-dashboards-ideas/allow-month-or-year-choices-on-date-selector/idi-p/1314770" target="_blank"&gt;https://community.esri.com/t5/arcgis-dashboards-ideas/allow-month-or-year-choices-on-date-selector/idi-p/1314770&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 14:59:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/date-selector-by-month/m-p/1315076#M8210</guid>
      <dc:creator>ChelseaRozek</dc:creator>
      <dc:date>2023-08-03T14:59:44Z</dc:date>
    </item>
  </channel>
</rss>

