I have a small table with only 9 records, published as a web service, which stores a bus route, the number of the bus assigned to that route, and a last updated date field. The bus number assigned to a route can change daily. I want to join this table with my GPS feed based on the bus number so I can know which route each bus is performing.
I used the service to create a feed since just using the service as an input does not get updates unless the analytic is restarted. But a feed just keeps appending data, so over time as bus numbers change I get multiple possible bus routes that will join with any given bus number. I want my feed to only ever have 9 records in it, so there is only one possible record to join to each bus number. I essentially want the feed to be overwritten everytime it goes out to get an update from the service. Is that possible?
If that's not possible, then I think I have to filter my feed so that the join is only using the most recent dated record for any given bus route. I can't find any example arcade code though that would do that (and I'm not really a programmer, so I rely a lot on examples). But even if I do this successful, it seems very inefficient, having to do this filter with every incoming GPS record. If the feed would just contain the most up to date records, the analytic load would be way less.
Any help or suggestions would be appreciated! Thanks.