<?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 Serial chart - display seasonality in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/serial-chart-display-seasonality/m-p/1115700#M5369</link>
    <description>&lt;P&gt;I have a multi-year COVID dataset (# new cases per day).&amp;nbsp; Currently this is displayed as a traditional time series, incrementing on the x-axis by day (see attachment TraditionalTimeSeries.JPG).&amp;nbsp; I've been asked to now show this dataset in a way that allows the user to see potential seasonality, by having the x-axis as months and days (BUT NO YEAR) and the y-axis as the # New Cases per Day, regardless of year.&amp;nbsp; In this way, the chart would show the number of new cases on each calendar day "superimposed" for both 2020 and 2021.&amp;nbsp; I've attached a fairly ugly mock up of the concept (Seasonality.png).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on how I might accomplish this in Dashboard?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Nov 2021 16:43:15 GMT</pubDate>
    <dc:creator>JayJohnsonWashoeCounty</dc:creator>
    <dc:date>2021-11-10T16:43:15Z</dc:date>
    <item>
      <title>Serial chart - display seasonality</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/serial-chart-display-seasonality/m-p/1115700#M5369</link>
      <description>&lt;P&gt;I have a multi-year COVID dataset (# new cases per day).&amp;nbsp; Currently this is displayed as a traditional time series, incrementing on the x-axis by day (see attachment TraditionalTimeSeries.JPG).&amp;nbsp; I've been asked to now show this dataset in a way that allows the user to see potential seasonality, by having the x-axis as months and days (BUT NO YEAR) and the y-axis as the # New Cases per Day, regardless of year.&amp;nbsp; In this way, the chart would show the number of new cases on each calendar day "superimposed" for both 2020 and 2021.&amp;nbsp; I've attached a fairly ugly mock up of the concept (Seasonality.png).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on how I might accomplish this in Dashboard?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 16:43:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/serial-chart-display-seasonality/m-p/1115700#M5369</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2021-11-10T16:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Serial chart - display seasonality</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/serial-chart-display-seasonality/m-p/1115760#M5372</link>
      <description>&lt;P&gt;Hey Jay&lt;/P&gt;&lt;P&gt;you should look at creating a new Data Expression on the Serial Chart settings. You could then create a featureset on the fly , splitting your MONTH/DAY field(s) and get the results you are looking for. (the sample link could give you some good ideas as well)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that can help you. Good luck!&lt;/P&gt;&lt;LI-CODE lang="python"&gt;// Write an expression that returns a FeatureSet.
// Documentation: https://arcg.is/3c419TD
// Samples: https://arcg.is/38SEWWz

var fs = FeatureSetByPortalItem(Portal('https://arcgis.com/'), 'YOURITEMID', 0, ["CallDateTime","callYear"], false);
var drFilter = "callYear in (2020,2021) and Agency in('AFD')"
var drSel = Filter(fs,drFilter)

//return count(drSel)

var combinedDict = {
  fields: [
    { name: "CallDateTime", type: "esriFieldTypeString" },
    { name: "callYear", type: "esriFieldTypeString" },
    { name: "callDay", type: "esriFieldTypeString" },
    { name: "callMonth", type: "esriFieldTypeString" },
    { name: "callMonthDay", type: "esriFieldTypeString" },
  ],
  geometryType: "",
  features: [],
};

var i = 0;
for (var d in drSel){
  combinedDict.features[i] = {
    attributes: {
      CallDateTime: d["CallDateTime"],
      callYear: d["callYear"], 
      callDay: Day(d["CallDateTime"]),
      callMonth: ISOMonth(d["CallDateTime"]),
      callMonthDay: ISOMonth(d["CallDateTime"])+'-'+Day(d["CallDateTime"])
    },
  };
  i++;    
        //return d["CallDateTime"] + " " + ISOMonth(d["CallDateTime"]) + " "+ Day(d["CallDateTime"])
}

//return combinedDict;
return FeatureSet(Text(combinedDict));&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRoberge2_1-1636568318579.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/27167iF4B13E1C11B85BDD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DominicRoberge2_1-1636568318579.png" alt="DominicRoberge2_1-1636568318579.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRoberge2_0-1636568086950.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/27166i582933EB75C6F411/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DominicRoberge2_0-1636568086950.png" alt="DominicRoberge2_0-1636568086950.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 18:20:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/serial-chart-display-seasonality/m-p/1115760#M5372</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2021-11-10T18:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Serial chart - display seasonality</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/serial-chart-display-seasonality/m-p/1115763#M5373</link>
      <description>&lt;P&gt;Good suggestion - thanks for the code sample.&amp;nbsp; I'll try this and report back.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 18:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/serial-chart-display-seasonality/m-p/1115763#M5373</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2021-11-10T18:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Serial chart - display seasonality</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/serial-chart-display-seasonality/m-p/1121956#M5434</link>
      <description>&lt;P&gt;While the FeatureSet code suggested by &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/366436"&gt;@DominicRobergeIADOT&lt;/a&gt;&amp;nbsp;looks promising, I couldn't make it work for me.&amp;nbsp; Instead I created a SQL view that somewhat creatively uses a calculated field "fakeDate" to push all the data into a single arbitrary year (1,000 AD to avoid potential confusion with any "real" datetime) and pushed the COVID New Cases for each year into separate attribute fields.&amp;nbsp; I published this view in a service and using this approach I can show the different years as series on a single chart and "fakeDate" as the Category axis.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;SQL View table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SeasonalityTable.JPG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/28657i989C895AE67070EA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeasonalityTable.JPG" alt="SeasonalityTable.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Dashboard Serial Chart:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SeasonalityChart.JPG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/28655i22E3329F75E4F21A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeasonalityChart.JPG" alt="SeasonalityChart.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;SQL View definition is shown below:&lt;/P&gt;&lt;P&gt;SELECT ROW_NUMBER() OVER(ORDER BY reportdt ASC) AS OBJECTID, reportdt, NewCases AS NewCases2020, null AS NewCases2021, DATEADD(year, -1020, reportdt) AS fakeDate&lt;BR /&gt;FROM COVID_CASESTABLE WHERE&lt;BR /&gt;(reportdt BETWEEN '2019-12-31' AND '2021-01-01')&lt;BR /&gt;UNION ALL&lt;BR /&gt;SELECT ROW_NUMBER() OVER(ORDER BY reportdt ASC) AS OBJECTID, reportdt, null AS NewCases2020, NewCases AS NewCases2021, DATEADD(year, -1021, reportdt) AS fakeDate&lt;BR /&gt;FROM COVID_CASESTABLE WHERE&lt;BR /&gt;(reportdt BETWEEN '2020-12-31'AND '2022-01-01')&lt;/P&gt;&lt;P&gt;This might get a bit cumbersome if we end up tracking COVID for 10 years, but in the meantime this was a quick, relatively simple workaround, if admittedly involving a bit of smoke and mirrors...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 21:52:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/serial-chart-display-seasonality/m-p/1121956#M5434</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2021-12-01T21:52:05Z</dc:date>
    </item>
  </channel>
</rss>

