Hello all - I am new to data expressions in ArcGIS dashboards, and have a question about combining two Feature Sets based on a shared column.
I have a "spent" Feature Set and an "available" Feature Set. These two Feature Sets share a "Fiscal Year" column. The "spent" Feature Set was created using a groupBy expression.
I want to combine these two feature sets so that I can create a calculated field dividing spent/available. I want to then show the values of this calculated field in a dashboard indicator.
See the below code for what I have so far. I can create the spent and available feature sets in the image above, but I don't know how to make the third table (output feature set) that combines the two.
//create a feature set with the original non-aggregated data used for the spent featureset
var non_aggregated_spent_fs = FeatureSetByPortalItem(Portal('https://www.arcgis.com'), 'xyz', '1')
//create a featureset with the data for the available featureset (this feature set is the "available" table in the image in my post)
var available_fs = FeatureSetByPortalItem(Portal('https://www.arcgis.com'), 'xyz', '2')
//create a featureset with the aggregated data for the spent featureset. (this featureset is the "spent" table in the image in my post)
var spent_fs = GroupBy(non_aggregated_spent_fs, ['FiscalYear'], [
{name: 'spent', expression: 'spentAmount', statistic: 'SUM' }]);
//create a featureset that combines available_fs and spent_fs by the shared fiscal year column, and then create a calculated field column dividing spent/available
Thank you for taking the time to review this post.
Hi,
Why don't you create a joined hosted feature layer view ?
https://doc.arcgis.com/en/arcgis-online/manage-data/create-hosted-views.htm