Hi everyone,
After the November update a data expression that worked previously is not working anymore.
I was able to pinpoint where it goes wrong, and its now the GroupBy expression. I can't use it to get a max date anymore. I get an empty table. If I change the statistic to "COUNT", it works. I can use the "MAX" statistic on any numeric field but no longer on the date fields.
My dictionary is set up as
var MainDict = {
fields: [
{name:'globalId', type:'esriFieldTypeString'}
,{name:'objectid', type:'esriFieldTypeInteger'}
,{name:'Cor_Date', type: 'esriFieldTypeDate'}
,{name:'Contractor', type: 'esriFieldTypeString'}
,{name:'Staff', type: 'esriFieldTypeString'}
,{name:'Cor_Expiry', type: 'esriFieldTypeDate'}
,{name:'activity', type: 'esriFieldTypeString'}
],
geometryType:'',
features:featArray,
};
var data = FeatureSet(Text(MainDict))
"return data" gives me the feature set, but I need to filter this to show only one record for each Contractor, activity and only the record with the latest expiry date. My group by statement was the following.
var test = GroupBy(data,['Contractor','activity'],[{name:'Cor_Expiry',expression:'Cor_Expiry',statistic:'MAX'},{name:'objectid',expression:'objectid',statistic:'MAX'}])
return test
I used to get a table that showed each contractor and activity with the most recent expiry date
Now I get the following:

Ideas on why the max statistic isn't working for dates anymore?