<?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 Creating a Temp Feature Set for Stacked Serial Chart in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-temp-feature-set-for-stacked-serial/m-p/1130624#M5625</link>
    <description>&lt;P&gt;I want to stack three different layers and group them by their own date field. For some reason, my Arcade code is working but no data is showing in the data table below. I am assuming this is a small tweak to the code but wasnt sure.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnnyHarley232_0-1641336271726.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/30778i6D1477EE99EEBBD2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohnnyHarley232_0-1641336271726.png" alt="JohnnyHarley232_0-1641336271726.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have the following arcade code, modeling as a template from this presentation&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/ops-dashboard/analytics/enhancing-dashboard-elements-using-data-expressions-part-1/" target="_self"&gt;https://www.esri.com/arcgis-blog/products/ops-dashboard/analytics/enhancing-dashboard-elements-using-data-expressions-part-1/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;var portal = Portal("https://planetscapeai.maps.arcgis.com/"); 
var alerts = GroupBy( 
  FeatureSetByPortalItem(portal,"9b11dda1c0804f13a72136a8bf71b93c",0,["*"],false), 
  ["Date"], 
  [ 
    { name: "Alerts1" ,expression: "FID", statistic:"COUNT" } 
  ] 
); 

var imagery = GroupBy( 
  FeatureSetByPortalItem(portal,"d70d948dd59c451bb56cc12a8f7aeb96",0,["*"],false), 
  ["Date"], 
  [ 
    { name: "Alerts2" ,expression: "FID", statistic:"COUNT" } 
  ] 
);

var survey = GroupBy( 
  FeatureSetByPortalItem(portal,"f18f6b7a0447412083228d6ce554f042",0,["*"],false), 
  ["CreationDate"], 
  [{ name: "Alerts3", expression: "objectid", statistic: "COUNT" }] 
);

var combinedDict = { 
  fields: [ 
    { name: "Type", type: "esriFieldTypeString" }, 
    { name: "CompletedDate", type: "esriFieldTypeDate" }, 
    { name: "NumberOfAlerts", type: "esriFieldTypeInteger" }, 
  ], 
  geometryType: "", 
  features: [], 
}; 

var i = 0; 
// Loop through each FeatureSet and store its attributes 
for (var m in alerts) { 
  combinedDict.features[i++] = { 
    attributes: { 
      Type: "Alerts", 
      CompletedDate: m["Date"], 
      NumberOfAlerts: m["Alerts1"], 
    }, 
  }; 
} 

for (var p in imagery) { 
  combinedDict.features[i++] = { 
    attributes: { 
      Type: "Imagery", 
      CompletedDate: p["Date"], 
      NumberOfAlerts: p["Alerts2"], 
    }, 
  }; 
}

for (var j in survey) { 
  combinedDict.features[i++] = { 
    attributes: { 
      Type: "Survey", 
      CompletedDate: j["CreationDate"], 
      NumberOfAlerts: j["Alerts3"], 
    }, 
  }; 
} 

// Return dictionary cast as a FeatureSet  
return FeatureSet(Text(combinedDict));   &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2022 22:38:05 GMT</pubDate>
    <dc:creator>JohnnyHarley232</dc:creator>
    <dc:date>2022-01-04T22:38:05Z</dc:date>
    <item>
      <title>Creating a Temp Feature Set for Stacked Serial Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-temp-feature-set-for-stacked-serial/m-p/1130624#M5625</link>
      <description>&lt;P&gt;I want to stack three different layers and group them by their own date field. For some reason, my Arcade code is working but no data is showing in the data table below. I am assuming this is a small tweak to the code but wasnt sure.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnnyHarley232_0-1641336271726.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/30778i6D1477EE99EEBBD2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohnnyHarley232_0-1641336271726.png" alt="JohnnyHarley232_0-1641336271726.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have the following arcade code, modeling as a template from this presentation&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/ops-dashboard/analytics/enhancing-dashboard-elements-using-data-expressions-part-1/" target="_self"&gt;https://www.esri.com/arcgis-blog/products/ops-dashboard/analytics/enhancing-dashboard-elements-using-data-expressions-part-1/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;var portal = Portal("https://planetscapeai.maps.arcgis.com/"); 
var alerts = GroupBy( 
  FeatureSetByPortalItem(portal,"9b11dda1c0804f13a72136a8bf71b93c",0,["*"],false), 
  ["Date"], 
  [ 
    { name: "Alerts1" ,expression: "FID", statistic:"COUNT" } 
  ] 
); 

var imagery = GroupBy( 
  FeatureSetByPortalItem(portal,"d70d948dd59c451bb56cc12a8f7aeb96",0,["*"],false), 
  ["Date"], 
  [ 
    { name: "Alerts2" ,expression: "FID", statistic:"COUNT" } 
  ] 
);

var survey = GroupBy( 
  FeatureSetByPortalItem(portal,"f18f6b7a0447412083228d6ce554f042",0,["*"],false), 
  ["CreationDate"], 
  [{ name: "Alerts3", expression: "objectid", statistic: "COUNT" }] 
);

var combinedDict = { 
  fields: [ 
    { name: "Type", type: "esriFieldTypeString" }, 
    { name: "CompletedDate", type: "esriFieldTypeDate" }, 
    { name: "NumberOfAlerts", type: "esriFieldTypeInteger" }, 
  ], 
  geometryType: "", 
  features: [], 
}; 

var i = 0; 
// Loop through each FeatureSet and store its attributes 
for (var m in alerts) { 
  combinedDict.features[i++] = { 
    attributes: { 
      Type: "Alerts", 
      CompletedDate: m["Date"], 
      NumberOfAlerts: m["Alerts1"], 
    }, 
  }; 
} 

for (var p in imagery) { 
  combinedDict.features[i++] = { 
    attributes: { 
      Type: "Imagery", 
      CompletedDate: p["Date"], 
      NumberOfAlerts: p["Alerts2"], 
    }, 
  }; 
}

for (var j in survey) { 
  combinedDict.features[i++] = { 
    attributes: { 
      Type: "Survey", 
      CompletedDate: j["CreationDate"], 
      NumberOfAlerts: j["Alerts3"], 
    }, 
  }; 
} 

// Return dictionary cast as a FeatureSet  
return FeatureSet(Text(combinedDict));   &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 22:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-temp-feature-set-for-stacked-serial/m-p/1130624#M5625</guid>
      <dc:creator>JohnnyHarley232</dc:creator>
      <dc:date>2022-01-04T22:38:05Z</dc:date>
    </item>
  </channel>
</rss>

