How to Calculate Number of Weekdays Between Two Dates
Bold BI users can calculate and showcase weekdays between two dates in a dashboard widget by use of a calculated column (a.k.a expression). The expression column will show the day difference between the two dates as explained in this article.
Use Case
For instance, in Project Management, the user would like to showcase the number of days between the task start date to the end date then the user must calculate the days between the two dates.
Creating the expression column
You can create the expression column with the date columns to show the number of weekdays. Follow the given steps to achieve this.
-
Click on fx Add Expression on the assign data tab to navigate to create the expression.
-
Configure the expression for the date as follows.
DATEDIFF(day,[start_date],[end_date])
Note: This expression has been tested with PostgreSQL and MSSQL, but it may not work for some data sources due to differences in the date formatting functions.
-
Click Save and Close the expression designer page.
Configuring the expression column to the widget
You can configure the expression column in the widget to showcase the number of days between the two dates. Refer to the following image which calculated the difference between start_date and end_date.