Hi All,
Working on a dashboard serial chart (Enterprise 11.3)...
I'm trying to filter a featureset in a data-expression by evaluating 2 date-fields
Here's my code...
var fs = FeatureSetByPortalItem(portal, '48ae0546f8ef4cd0b7039cd44ed0f4b4')
Console(Count(fs))
//var crFilt = `Date_Created < DateAdd(DATUM, -1, 'months')` //not working
var crFilt = `Date_Created < DATEADD('month', -1, DATUM)` //not working SQL92 syntax
var resFs = Filter(resFs, crFilt);
Console(Count(resFs))
So I want to substract 1 month from the date in field [DATUM] and filter the records where [Date_Created] < recalculated fieldvalues...
Could this be done? Or is "DateAdd" just not supported?
I'm getting this error in both cases: "Test execution error: Invalid parameters for call to DATEADD. Verify test data."
Thanks in advance..
Manipulating dates and times are very data source specific, so it would be helpful if you shared the back-end data store the data resides in.
It's a hosted feature layer, So I'm using the ArcGIS relational datastore on ArcGIS 11.3.
The ArcGIS Relational Data Store is based on PostgreSQL, which doesn't support DATEADD. Try using native PostgreSQL Date/Time functions: https://www.postgresql.org/docs/current/functions-datetime.html