HOW TO

Group date values by week in the ArcGIS Dashboards serial chart elements

First Published: September 7, 2026
Last Published: September 7, 2026

Summary

In ArcGIS Dashboards, serial chart elements currently do not support aggregating date values by week as a date resolution. However, a data expression can be used to create a new text field that assigns each date to the start date of its corresponding week. This is useful when temporal analysis focuses on weekly patterns rather than individual dates. Grouping date values by week reduces clutter and makes trends easier to identify over time.

Browse this article for the workflow to group date values by week in the ArcGIS Dashboards serial chart elements, and in this example, a column chart is configured to display total sales grouped by week for each city.

Procedure

  1. In ArcGIS Dashboards, create a new dashboard and add a map element. Refer to ArcGIS Dashboards: Create a dashboard for instructions.
  2. On the dashboard’s toolbar, click Add element, place an element on the layout and select Serial chart to create a serial chart element.
  3. In the Select a layer window, under Data expressions, click New data expression to create a new data expression.
  1. In the Edit data expression window, specify the expression to extract date values from the date field into a new text field representing the start date of each corresponding week, with Sunday as the first day of the week. Replace <fieldName1> and <fieldName2> with the preferred field names, <dateField> with the name of the date field, and <fieldName3> with the preferred name for the new field. Then click Run.
// Write an expression that returns a FeatureSet.
// Documentation: https://arcg.is/3c419TD
// Samples: https://arcg.is/HPbi00

// Add portal/layer info
var fs = FeatureSetByPortalItem(
    Portal('<PortalURL>'),  // Replace <PortalURL> with URL of the portal
    '<ItemID>',  // Replace <ItemID> with the layer ID
    [<LayerIndex>],  // Replace <LayerIndex> with the layer index
    ['<Label1>', '<Label2>', '<dateLabel>'], // Replace <Label1>, <Label2>, and <dateLabel> with the preferred label name
    false
);

// Create columns for each of your fields
var newDict = {
    fields: [
      { name: "<fieldName1>", type: "esriFieldTypeString" },
        { name: "<fieldName2>", type: "esriFieldTypeInteger" },
        { name: "<dateField>", type: "esriFieldTypeDate" },
        { name: "<fieldName3>", type: "esriFieldTypeString" }
        ],
    'geometryType': '',
    "spatialReference": {},
    'features': []
};

// loop through each feature in the layer and populate columns
var i = 0;
for (var f in fs) {
  var edate = f['<dateLabel>']
  var ws = Text(DateAdd(edate, -Weekday(edate), 'days'), "YMMDD")

  newDict.features[i++]={
    attributes:{
       <fieldName1>: f['<Label1>'],
       <fieldName2>: f['<Label2>'],
       <dateField>: f['<dateLabel>'],
       <fieldName3>: ws
    }
   }
}

return FeatureSet(newDict)

Below is the complete working script for this example.

// Write an expression that returns a FeatureSet.
// Documentation: https://arcg.is/3c419TD
// Samples: https://arcg.is/HPbi00

// Add portal/layer info
var fs = FeatureSetByPortalItem(
    Portal('https://www.arcgis.com'),
    'e63814c9b04a4ghb84362ba8274ed5a5',
    [1],
    ['cityName', 'totalSales', 'salesDate'], 
    false
);

// Create columns for each of your fields
var newDict = {
    fields: [
      { name: "CityName", type: "esriFieldTypeString" },
        { name: "TotalSales", type: "esriFieldTypeInteger" },
        { name: "SalesDate", type: "esriFieldTypeDate" },
        { name: "NewField", type: "esriFieldTypeString" }
        ],
    'geometryType': '',
    "spatialReference": {},
    'features': []
};

// loop through each feature in the layer and populate columns
var i = 0;
for (var f in fs) {
  var edate = f['salesDate']
  var ws = Text(DateAdd(edate, -Weekday(edate), 'days'), "YMMDD")

  newDict.features[i++]={
    attributes:{
        CityName: f['cityName'],
        TotalSales: f['totalSales'],
        SalesDate: f['salesDate'],
        NewField: ws
    }
   }
}

return FeatureSet(newDict)
The output is displayed in the NewField field
  1. Click Done.
  1. In the Serial chart window, on the Data tab, set the configurations under Data options.
  1. For Categories from, select Grouped values.
  2. For Category field, select the new field from the drop-down list. In this example, it is NewField.
  3. Toggle Parse dates on.
  4. For Parsing pattern, select yyyyMMdd from the drop-down list.
  5. For Resolution, select Day from the drop-down list.
  6. For Statistic, select the preferred summary statistic from the drop-down list. In this example, the Sum option is selected.
  7. For Field, select the preferred field from the drop-down list. In this example, the TotalSales field is selected.
The configurations set under Data options
  1. On the Series tab, under Series options, for Type, select Column. Configure the element as required.
Note:
Optionally, create a stacked column chart to split the values into groups by selecting the preferred field name from the Split by field drop-down list on the Data tab and selecting Stacked on the Series tab of the Serial chart window. Refer to How To: Create a stacked chart in ArcGIS Dashboards for instructions. 
  1. Click Done. Click Save The Save icon > Save on the dashboard’s toolbar.

The dashboard below displays weekly total sales for each city in the column chart.

The weekly total sales for each city in a column chart

Article ID: 000043116

Software:
  • ArcGIS Dashboards

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options