When I use the following expression to calculate the Heat Index in AGOL, the expression works great. When I use this same expression in a calc field tool in Velocity, I get an error. If I remove the "if" statements, then I don't get an error and can run the analytic. What am I missing for the reasoning that I am getting this error?
var dictempF = $feature.last_values
var dicvartempF = Dictionary(dictempF)
var tempF = Round((dicvartempF.field1.value * 9/5) + 32,1)
var dichumidity = $feature.last_values
var dicvarhumidity = Dictionary(dichumidity)
var humidity = Round((dicvarhumidity.field2.value),1)
var T = tempF
var RH = humidity
var HI = -42.379 + 2.04901523*T + 10.14333127*RH - .22475541*T*RH - .00683783*T*T - .05481717*RH*RH + .00122874*T*T*RH + .00085282*T*RH*RH - .00000199*T*T*RH*RH;
if (RH < 13 && T > 80 && T < 112) HI -= ((13-RH)/4)*SQRT((17-ABS(T-95.))/17);
if (RH > 85 && T > 80 && T < 87) HI += ((RH-85)/10) * ((87-T)/5);
if (HI < 80) HI = 0.5 * (T + 61.0 + ((T-68.0)*1.2) + (RH*0.094));
return Round(HI, 1);
Error:
