Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I wish to calculate the average time between when a job is created and scheduled. I am stuck as how I should do this.
Below shows my data and my output so far from Qlik. The first two jobs were created on 5th June, though they were planned to be undertaken on 6th June. You will see that the average works fine when considering job before 5pm and after 5pm. However, it doesn't when I look at the whole day.
Thanks in advance for your help.
Typically you would want to convert these two fields to one timestamp field, at which point you can just subtract one from the other. You can do this using Timestamp#(), explicitly convert them as required using date#() and time#() or, if the fields are already recognized as a date and a time, you can just use [PlannedDate] + [Schedule Time].
Note that from a performance perspective, you should consider whether you want this done in the script (which will make the app larger due to the storage of the timestamp) or on the front end (which will keep the app smaller but may impact runtime performance).
Typically you would want to convert these two fields to one timestamp field, at which point you can just subtract one from the other. You can do this using Timestamp#(), explicitly convert them as required using date#() and time#() or, if the fields are already recognized as a date and a time, you can just use [PlannedDate] + [Schedule Time].
Note that from a performance perspective, you should consider whether you want this done in the script (which will make the app larger due to the storage of the timestamp) or on the front end (which will keep the app smaller but may impact runtime performance).
Hi Or, thanks for your suggestion. I went back to the source data and created timestamp data and then subtracted JobScheduled timestamp from JobCreated timestamp.