Hi all,
Hoping someone wouldn't mind helping me out please.
I'm looking to create a Deluge script that I can run on a scheduled basis (once weekly).
In essence, we have a module in our CRM called "Bookings", which houses records of all bookings made.
In each record, there are 4 main fields that I think will be needed for this script:
Status = the status of the record (a dropdown list of values)
Report TAT = the turnaround time of the report in number of days (a free text field, but there is a separate function which automatically calculates this and updates this field)
Specialist = the name of the Specialist doing the booking.
Completed Date = a DD/MM/YYYY field that is manually entered when the report is completed.
The Specialist field is linked to the Specialist Module (wherein each record in the Specialist module is 1 per Specialist, and contains all information about the Specialist). There is a field in this module called "Average TAT".
In short, I'd like to create a schedule that will query all records in Status of "Status XX", "Status YY", or "Status ZZ" that have been completed within the last 6 months, and then provide an average TAT (number of days) per Specialist.
Then update that average TAT into the Specialist module, against each individual specialist in the Average TAT (but only if they've actually completed a booking within that 6 month period).
So Specialist 1 finished 4 reports in the last 6 months, with TAT of 20, 25, 20 and 23. After running the scheduled script, the Average TAT for that specialist should be updated to 22.
I guess we would need to do a loop through all records to match the criteria, but then I'm not sure how to calculate an average, or how to update a record in a separate module.
I would appreciate any help anyone could offer here.
Cheers,
Mark