I’m trying to detect incidents in our location tracking data where users are accelerating and braking quickly. I’m using the GeoAnalytics tool “Detect Incidets”. (I’m following the example described in the workflow ‘Detecting Incidents Using Track Data’ on https://earlyadopter.esri.com .)
When I copy the expression to signify the start of an incident I get a Syntax Error. Here is the expression that I copy in the expression field:
var acceleration = abs(($track.field["speed"].history(-2)[0] - $feature.speed)/(DateDiff($track.field["location_timestamp"].history(-2)[0], $feature.location_timestamp, "seconds")))
acceleration >= 2 && $feature.activity == 5
My colleagues and I couldn’t find an error in the syntax. Do we overlook something in the expression or could there be another reason?
Thanks
Sonja
Solved! Go to Solution.
Hi Sonja,
So the Arcade Editor is not aware of the GeoAnalytics "$track" variable and will say the syntax is invalid. But if you just paste the text directly into the text box (don't open the editor) and run the tool it should work.
Another thing to check is the quote characters. Sometimes when copy and pasting the quotes are converted to smart quotes which are different than regular ascii quotes.
Hi Sonja,
So the Arcade Editor is not aware of the GeoAnalytics "$track" variable and will say the syntax is invalid. But if you just paste the text directly into the text box (don't open the editor) and run the tool it should work.
Another thing to check is the quote characters. Sometimes when copy and pasting the quotes are converted to smart quotes which are different than regular ascii quotes.
Thank you very much Aaron for your helpful and prompt reply! I tested to paste the text directly into the text box and it worked.