Select to view content in your preferred language

GroupBy null Date and not null Date pie chart

264
0
03-10-2023 12:11 PM
Labels (1)
JustinWolff
Occasional Contributor

I'm not great with Arcade and stumped.  I'm trying to create a pie chart in a Dashboard based on two date fields, 'Ordered' and 'Received'.  Records are either null or populated with the date ordered or received.  I'd like the pie chart to show counts of Ordered and Received.  I think I need to use the GroupBy function, but I'm not sure what I'm doing.  Thanks.

 

var p = <portal>;
var tracts = FeatureSetByPortalItem(Portal(p),<item>,
    <id>,
    [
        'OBJECTID',
        'Name',
        ‘Ordered',
        'Received',
    ],
    false
);
var count = GroupBy(tracts,
  [  // fields/expressions to group statistics by
    { name: ‘Ordered', expression: 'Received IS NOT NULL'},
    { name: ‘Received', expression: 'Received IS NULL'}
  ],
  [
      {name: 'Ordered', expression: '1', statistic: 'COUNT'}
]);
return(count)

 

 

Tags (1)
0 Kudos
0 Replies