Select to view content in your preferred language

Arcade data expression in dashboard with Groupby function returns null values

577
1
10-13-2023 02:13 AM
Arpa_PiemonteGeoportal_Team
Frequent Contributor

Dear All, I am trying  to calculate the sum of values grouped by two fields, however it returns null values and, in addition to this, it seems it doesn't group at all (see image attached).

Any idea?

My dahboard is running on Portal for Arcgis 11.1.

Thank you in advance.

Here is the code:

var myPortal = Portal('https://www.myportal.it/portal');
var itemId = '123456789';
var layerId = 0;
var fs = FeatureSetByPortalItem(myPortal,itemId, layerId,
['cod_reg','anno','csuolo8','clammi3_num'],false);

Console('Somma clammi3_num: ', sum(fs,'clammi3_num'));
Console('primo record: ',First(fs));

return GroupBy(fs, ['anno','cod_reg'], [
{name: 'sum_clammi', expression: 'clammi3_num', statistic: 'SUM' },
{name: 'sum_csuolo', expression: 'csuolo8', statistic: 'SUM' }
]);

 

Arpa_PiemonteGeoportal_Team_0-1697188323912.png

 

1 Reply
ml_caln_france
New Contributor

Hello,

I have the same problem (on Arcgis 10.9.1). I really don't get why it does not work. I ended up copying the data in a new FeatureSet the same way it is done in this subject  https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-groupby-not-groupin...

I am not quite satisfied that the normal way does not work but still, it prevents from creating new tables in the database. I hope it can be useful as much as I hope someone will find a better way to do it 🙂

0 Kudos