How to Calculate Average Turnaround Time in BoldBI
In certain scenarios, you may need to calculate the average turnaround time between two dates for multiple orders. This article will guide you through the process of calculating the average turnaround time using BoldBI.
Steps to Calculate Average Turnaround Time
Consider you have the below data
Step 1: Calculate Average Turnaround Time in Seconds
To calculate the average turnaround time in seconds, use the following expression:
TOTAL(SUM(DATEDIFF(s, [startdate], [enddate])))/ <Total number of items>
Replace [startdate]
and [enddate]
with the appropriate column names from your dataset.
Step 2: Convert the Seconds into the Desired Format
To convert the seconds into the desired format (e.g., days, hours, minutes, and seconds), use the following expression:
convert(varchar, FLOOR([Total time difference]/86400)) + 'd' + ' ' + convert(varchar, FLOOR([Total time difference]%86400/3600)) + ':' + convert(varchar, FLOOR([Total time difference] %3600/60)) + ':' + convert(varchar, FLOOR(([Total time difference])%60))
Replace [Total time difference]
with the result from Step 1.
The time difference will be retrieved in the required format.
Note: These expression has been tested with Microsoft SQL Server, but it may not work for some data sources due to differences in the date formatting functions.
Conclusion
By following these steps, you can calculate the average turnaround time for multiple orders using BoldBI. If you need further assistance, please feel free to reach out to our support team.