Date

170
2
a week ago
Labels (2)
IroGeorgopoulou
New Contributor II

Hello everyone!

I need some help! How can I automate the below procedure: select by attribute (to select specific records in a table sorted by a code field) and autocomplete the most recent date record with a previous date record of another field? The purpose is to have two date fields containing start date and end date per record. But these records respond to specific locations. This must be done on a weekly basis so each time, I have to update the date data with new end dates, filling the new rows with the date data of last inspection date as the start of a new one. I don't know if this can be done at once. In pro or using python, arcade...Thanks in advance

0 Kudos
2 Replies
AlfredBaldenweck
MVP Regular Contributor

I think this should be pretty easy but it'd be a lot easier with a sample. 

Could you please provide one?

0 Kudos
IroGeorgopoulou
New Contributor II

Hi, thank you very much for your kind reply!

I am new with Python, I think that it could be pretty easy....

Well, below is an example of the workflow I need to accomplish: I have a point feature class with all data I need. It includes traps with their regular inspections details (all stored in one feature, I don't have a point dataset and a related table with inspection data and I don't know if it would make a problem for my next steps when I want to publish and update my dashboard app online. Your advice would be nice for this, too). Anyway, my problem is that I want to fill the timerange field with the date difference between the "last" and "previous" inspection dates per trapcode. For example for trap1 I must fill in the timerange field of second record with 27/723-5/7/23 = 22 days, the third srecord with 1/8/23-27/7/23=4 days atc

I want to find a workflow to do that automatically, but I am confused because the date data are stored in the same field and I want to do that per trap code not just erase the one record from the previous one. (I don't know, it will work if I sort them out first?).... I added a second field and name it "previous_date" to complete the arcade diff() expression but since I did it by hand I am not sure if it is the most appropriate way because in the future there will be lot of records to update!  

IroGeorgopoulou_0-1714206045304.jpeg

Any comment would be very helpful!

Thanks in advance!

0 Kudos