I am trying to categorize data using arcade and dates. It worked on a previous project but not working on the new dataset. If the date is older than today - call it red. If within 1 year - call it yellow and if over 1 year from now call it green. I only seem to get one response of Red, but the data has values that should give me all three categories.
var year = DateDiff(Now(), $feature["Next_Audit_Date"],'years');
return When(year <= 1, 'Yellow', year > 1, 'Green', 'Red');