<?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: Create accumulative charts in Dashboards in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1094768#M5014</link>
    <description>&lt;P&gt;Hi, just in case someone gets the same problem I managed to solve it by converting the date to show in the results table to UNIX system.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Sep 2021 02:14:53 GMT</pubDate>
    <dc:creator>JuanSthebanSanchezAragon</dc:creator>
    <dc:date>2021-09-02T02:14:53Z</dc:date>
    <item>
      <title>Create accumulative charts in Dashboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1090789#M4980</link>
      <description>&lt;P&gt;Hi, thanks for reading:&lt;/P&gt;&lt;P&gt;I´m trying to create a serial chart that allowed me to display the sum of a project, accumulating progress day by day. for example: 01/01/2021: 220 meters -&amp;gt; 02/01/2021: 320 (100 meters from 02/01/2021 + 220 meters from 01/01/2021), and so on. That would be really helpfull as is a really common chart in project management.&lt;/P&gt;&lt;P&gt;It was already asked in the community a year ago without a directa solution(&lt;A href="https://community.esri.com/t5/arcgis-dashboards-questions/esri-dashboard-create-cumulative-chart/td-p/177802" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-dashboards-questions/esri-dashboard-create-cumulative-chart/td-p/177802&lt;/A&gt;) but I´m wondering if the new arcade Dashboard expression could solve this.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="grafica de avance acumulado.JPG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21246i7CD5BA9407DAC69B/image-size/large?v=v2&amp;amp;px=999" role="button" title="grafica de avance acumulado.JPG" alt="grafica de avance acumulado.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thanks a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 14:01:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1090789#M4980</guid>
      <dc:creator>JuanSthebanSanchezAragon</dc:creator>
      <dc:date>2021-08-20T14:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create accumulative charts in Dashboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1090825#M4981</link>
      <description>&lt;P&gt;Data Expressions can definitely do this. In the example below, pay attention to the for loop. In it, the original FeatureSet is filtered to all features at or before the given timestamp and summed. Thus, for each distinct date in my input FeatureSet, I will get the running total.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Get your input layer
var fs = FeatureSetByPortalItem(Portal('https://kendall.maps.arcgis.com'), 'a405b06ae8e24f94a2768a4581b79e73', 0, ['sale_date', 'sale_amount'], false)

// Filtering input to a single quarter.
var sales_17q1 = Filter(fs, "sale_date &amp;lt; timestamp '2017-04-01' and sale_date &amp;gt; timestamp '2017-01-01'")

// Grouping by sale date to get per-date total
var sales = GroupBy(sales_17q1, 'sale_date', {name: 'total', expression: 'sale_amount', statistic: 'SUM'})

var fs_dict = {
    fields: [
        {name:'date', type:'esriFieldTypeDate'},
        {name:'running_sum', type:'esriFieldTypeDouble'}],
    geometryType: '',
    features: []
}

var i = 0

for(var s in sales){
    // Get all dates before or equal to date
    var filt_date = s['sale_date']
    var running_sum_fs = Filter(sales, "sale_date &amp;lt;= @filt_date")
    
    // Populate dict
    fs_dict.features[i] = {
        attributes: {
            'date': filt_date,
            'running_sum': Sum(running_sum_fs, 'total')
        }
    }
    
    console(filt_date)
    console(sum(running_sum_fs, 'sale_amount'))
    
    i ++
}

featureset(text(fs_dict))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Once you have it output, you can also parse the dates if you like. You can also modify the expression to group your values by different time spans.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1629473237053.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21253i5A047D187376AD3B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1629473237053.png" alt="jcarlson_0-1629473237053.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 15:27:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1090825#M4981</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-08-20T15:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create accumulative charts in Dashboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1091206#M4985</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi thanks for the answer it was so accurate, I almost got it but I just can´t make it to show me the table with the data with (return FeatureSet(Text(fsDict));)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Empty table.JPG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21354iFDDD91A744B70964/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Empty table.JPG" alt="Empty table.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Weird thing as if I return just the for loop (return fs_dict;) the array shows the correct information. Could you help me please telling me whats wrong with my sentence please. Thank you so much.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arrays.JPG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21355i9F9B567940EA890D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arrays.JPG" alt="arrays.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Array.JPG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21356i21052CDF72B84E9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Array.JPG" alt="Array.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 13:18:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1091206#M4985</guid>
      <dc:creator>JuanSthebanSanchezAragon</dc:creator>
      <dc:date>2021-08-23T13:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create accumulative charts in Dashboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1094768#M5014</link>
      <description>&lt;P&gt;Hi, just in case someone gets the same problem I managed to solve it by converting the date to show in the results table to UNIX system.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 02:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1094768#M5014</guid>
      <dc:creator>JuanSthebanSanchezAragon</dc:creator>
      <dc:date>2021-09-02T02:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create accumulative charts in Dashboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1122279#M5437</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;First of all I am a beginner to all but the most basic arcade expressions so this is all brand new to me. I want to be able to create cumulative charts that sum a value and allow the data to be parsed by date.&amp;nbsp; The example i'm trying here is to sum all my invoices starting from Jan 1st, 2021 going forward.&amp;nbsp; I've modified the below expression which I got from the above post .&amp;nbsp; Seems like it should work but all i get is a Execution Error: Error.&amp;nbsp; Not very helpful for troubleshooting.&amp;nbsp; Is there something i'm missing???&amp;nbsp; I feel like its probably with my filter date expression but that just a guess.&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;P&gt;// Get your input layer&lt;BR /&gt;var fs = FeatureSetByPortalItem(Portal('***********'), '************', 0, ['Invoice_Date', 'Invoice_Total'], false)&lt;/P&gt;&lt;P&gt;// Filtering input to a single quarter.&lt;BR /&gt;var invoices_21 = Filter(fs, "Invoice_Date &amp;gt; '2021-01-01'")&lt;/P&gt;&lt;P&gt;// Grouping by sale date to get per-date total&lt;BR /&gt;var invoicing = GroupBy(invoices_21, 'Invoice_Date', {name: 'total', expression: 'Invoice_Total', statistic: 'SUM'})&lt;/P&gt;&lt;P&gt;var fs_dict = {&lt;BR /&gt;fields: [&lt;BR /&gt;{name:'date', type:'esriFieldTypeDate'},&lt;BR /&gt;{name:'running_sum', type:'esriFieldTypeDouble'}],&lt;BR /&gt;geometryType: '',&lt;BR /&gt;features: []&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;var i = 0&lt;/P&gt;&lt;P&gt;for(var s in invoicing){&lt;BR /&gt;// Get all dates before or equal to date&lt;BR /&gt;var filt_date = s['Invoice_Date']&lt;BR /&gt;var running_sum_fs = Filter(invoicing, "Invoice_Date &amp;lt;= @filt_date")&lt;BR /&gt;&lt;BR /&gt;// Populate dict&lt;BR /&gt;fs_dict.features[i] = {&lt;BR /&gt;attributes: {&lt;BR /&gt;'date': filt_date,&lt;BR /&gt;'running_sum': Sum(running_sum_fs, 'total')&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;console(filt_date)&lt;BR /&gt;console(sum(running_sum_fs, 'Invoice_Total'))&lt;BR /&gt;&lt;BR /&gt;i ++&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return featureset(text(fs_dict))&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 17:49:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1122279#M5437</guid>
      <dc:creator>JoshHabel</dc:creator>
      <dc:date>2021-12-02T17:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create accumulative charts in Dashboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1300734#M7973</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;and/or others.&amp;nbsp; I am attempting something similar.&amp;nbsp; I am tracking cumulative repairs made per date and want to graph that with a serial chart in a dashboard.&amp;nbsp; For example, if 5 repairs were made on Oct-1 and 20 repairs were made on Oct-15 then the chart would show 5 on Oct-1 and 25 on Oct-15 (the sum the number of repairs on Oct-1 and Oct-15), etc.&amp;nbsp; When I run the below code in the Arcade Playground the &lt;FONT color="#800000"&gt;Console&lt;/FONT&gt; results look somewhat promising, though the first date is missing a total:&amp;nbsp; &lt;STRONG&gt;2021-09-30&lt;/STRONG&gt;T19:00:00-05:00, &lt;STRONG&gt;2021-10-31&lt;/STRONG&gt;T19:00:00-05:00&amp;nbsp; &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;9&lt;/STRONG&gt;&lt;/FONT&gt;, &lt;STRONG&gt;2021-12-31&lt;/STRONG&gt;T18:00:00-06:00 &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;16&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;,&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;2022-01-31&lt;/STRONG&gt;T18:00:00-06:00 &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;21&lt;/FONT&gt;&lt;/STRONG&gt;, etc.&amp;nbsp; But, the &lt;FONT color="#800000"&gt;Output&lt;/FONT&gt; is empty:&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;featureSet:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;date | running_sum | FID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code that I am currently using.&amp;nbsp; Any suggestions?&amp;nbsp; Thank you!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Get your input layer
var fs = FeatureSetByPortalItem(Portal('https://*****.maps.arcgis.com'), 'deaef816ff7448dc8fae43bca1a23418', 0, ['Actual_Completed_Date'], false);

// Filtering input to dates of interest.
var fuaCompleted = Filter(fs, "Actual_Completed_Date &amp;gt; timestamp '2020-01-01'");

// Grouping by completion date to get per-date total
var completionDate = GroupBy(fuaCompleted, 'Actual_Completed_Date', {name: 'total', expression: '1', statistic: 'COUNT'});

var fs_dict = {
    fields: [
        {name: 'date', type: 'esriFieldTypeDate'},
        {name: 'running_sum', type: 'esriFieldTypeDouble'}
    ],
    geometryType: '',
    features: []
};

var i = 0;

for (var f in completionDate) {
    // Get the date
    var filt_date = f['Actual_Completed_Date'];
    
    // Log the date for debugging
    console(filt_date);
    
    // Get all dates before or equal to the current date
    var running_sum_fs = Filter(completionDate, "Actual_Completed_Date &amp;lt;= @filt_date");
    
    // Calculate the running sum
    var running_sum = Sum(running_sum_fs, 'total');
    
    // Log the running sum for debugging
    console(running_sum);
    
    // Populate the feature set dictionary
    fs_dict.features[i] = {
        attributes: {
            'date': filt_date,
            'running_sum': running_sum
        }
    };
    
    i++;
}

featureset(text(fs_dict));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 15:10:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1300734#M7973</guid>
      <dc:creator>AshleyHayes2</dc:creator>
      <dc:date>2023-06-19T15:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create accumulative charts in Dashboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1300866#M7977</link>
      <description>&lt;P&gt;I think this may have done it, but happy to hear suggestions for improvement.&amp;nbsp; Thanks.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var fs = FeatureSetByPortalItem(Portal('https://******.maps.arcgis.com'), 'deaef816ff7448dc8fae43bca1a23418', 0, ['Actual_Completed_Date'], false);

var fuaCompleted = Filter(fs, "Actual_Completed_Date &amp;gt; timestamp '2020-01-01'");

var completionDate = GroupBy(fuaCompleted, 'Actual_Completed_Date', {name: 'total', expression: '1', statistic: 'COUNT'});

var fs_dict = {
    fields: [
        { name: 'date', type: 'esriFieldTypeDate' },
        { name: 'running_sum', type: 'esriFieldTypeDouble' }
    ],
    features: []
};

var i = 0;

for (var f in completionDate) {
    var filt_date = f['Actual_Completed_Date'];
    var running_sum_fs = Filter(completionDate, "Actual_Completed_Date &amp;lt;= @filt_date");
    var running_sum = Sum(running_sum_fs, 'total');
    
    fs_dict.features[i] = {
        attributes: {
            'date': filt_date,
            'running_sum': running_sum
        }
    };
    
    i++;
}

return featureset(fs_dict);&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 19 Jun 2023 22:02:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1300866#M7977</guid>
      <dc:creator>AshleyHayes2</dc:creator>
      <dc:date>2023-06-19T22:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create accumulative charts in Dashboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1543184#M10332</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp; - Similar to the original post, I have fields for year_range but not sure how to make it cumulative from years past in the code, and differentiate "new" vs "old"?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 14:45:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1543184#M10332</guid>
      <dc:creator>apgis16</dc:creator>
      <dc:date>2025-02-04T14:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create accumulative charts in Dashboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1571943#M10610</link>
      <description>&lt;P&gt;Reviving this thread because I was able to get halfway there with what&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;provided, but struggling to add another field that performs the same function but against a different date field.&lt;/P&gt;&lt;P&gt;I can get them to function as independent data expressions but I'm looking to get these values on the same serial chart&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 20:30:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/create-accumulative-charts-in-dashboards/m-p/1571943#M10610</guid>
      <dc:creator>BenGultch1</dc:creator>
      <dc:date>2024-12-31T20:30:39Z</dc:date>
    </item>
  </channel>
</rss>

