AnsweredAssumed Answered

Using Arcade to dynamically symbolize points depending on time differences

Question asked by jsklovengill_HoodRiver on May 10, 2018
Latest reply on May 10, 2018 by jsklovengill_HoodRiver

I am trying to symbolize a map based on time elapsed from a field "DATE_ISSUE" to today (aka: Today()), where if the point is less than 6 months old, it is "active"; more than a year old, it is "expired"; between 6 months and a year, it is "old"; and if no date has been entered into "DATE_ISSUE", it is "pending"

 

I have a test record of 67 points. 24 have not been issued a date, 1 point is from December 8, 2016 (518 days old), 1 is from September 8, 2017 (244 days old), 1 is from May 12, 2017 (363 days old), the rest are from January 2018 onward.

 

I have this so far:

 

var pDate = Date(Today());
var rDate = Date($feature["DATE_ISSUE"]);
var age = DateDiff(pDate, rDate, 'days');
if (age < 182.5){
"ACTIVE"
}
else if(age >= 182.5 && age <355){
"OLD"
}
else if (age >= 365 && age < 10000){
"EXPIRED"
}
else if (age > 10000){
"PENDING"
}

 

This last else if clause is the result of a bank "DATE_ISSUE" field being calculated in the DateDiff function as 17,661.33

 

This gives me 40 "Active", 24 "Pending", and the three objects over 182.5 days old are simply gone. Literally.  My attribute table shows all 67. My symbology options, show a total of 64 points, and 0 in "other". When I check "other", the 3 show up, even though the count is 0. 

 

When I check the DateDiff Function, there are no values generated beyond 126  days, with the exception of the before mentioned 17,661.33. 

 

Just looking to visually flag expired or old points so office staff don't have to look them up

Outcomes