Hi guys,
I have a table that I want to use the groupby function in 2 different ways, then join it back to calculate the percentages to display on ArcGIS dashboard. I am very new to ArcGIS Arcade so this has been a major struggle. Can someone please provide some guidance?
What I have got so far:
//Grab data
var fs = FeatureSetByPortalItem(portal,'id',0,['LGA','Activity']);
//Table 1
var LGA_Activity_Count = GroupBy(fs,['LGA','Activity'],[
{name: 'Local_Activity_Count', expression: 'Activity', statistic: 'Count'},]);
//Table 2
var LGA_Activity_Count = GroupBy(fs,['Activity'],[
{name: 'State_Activity_Count', expression: 'Activity', statistic: 'Count'},]);
//Join Table
//(Table 1 divide by table 2) * 100 to work out the percentages