We have Enterprise 10.9.1, working with Map Viewer (new). The requirement of my label expression is that it shows the soonest (approaching) date. Candidate values exist in 4 fields. Does arcade have the facility to select the minimum date?
In Python in Pro this was done with an array and min().
def FindLabel ( [DEADLINE_1], [DEADLINE_2], [DEADLINE_3], [DEADLINE_4] 😞
dt1 = datetime.datetime.strptime([DEADLINE_1], '%m/%d/%Y')
dt2 = datetime.datetime.strptime([DEADLINE_2], '%m/%d/%Y') if [DEADLINE_2] is not None else datetime.datetime.strptime('12/31/9999', '%m/%d/%Y')
dt3 = datetime.datetime.strptime([DEADLINE_3], '%m/%d/%Y') if [DEADLINE_3] is not None else datetime.datetime.strptime('12/31/9999', '%m/%d/%Y')
dt4 = datetime.datetime.strptime([DEADLINE_4], '%m/%d/%Y') if [DEADLINE_4] is not None else datetime.datetime.strptime('12/31/9999', '%m/%d/%Y')
ar = [dt1, dt2, dt3, dt4]
ret = min(ar).strftime('%m/%d/%Y')
return ret
Thanks in advance!