5 Replies Latest reply on Jul 21, 2017 8:06 AM by Tapiwa Sunde

    Business Day Number

    Tapiwa Sunde

      I am trying to show trending and comparison of funding for the past 3 months.  So to accomplish this I have to show the Business day number and the loan amount then the line graph for each month.  What I have managed to do is to put the calendar date but the client whats the business Day number.  An example is for the month of June instead of showing the 30 days I expect 22 days.

      How can I accomplish this

      Attached is the workbook with what I have done.

       

      Thank you in advance.

        • 1. Re: Business Day Number

          Hi Tapiwa,

          Please take a look at this Community post, and let us know if you still have questions. This post goes into some of the nuances that accompany this question. For example: do you want to exclude Holiday? Does your data include or exclude weekends? And it gives suggestions for multiple ways of tackling this.

           

          How to use number of business days in monthly utilization calculation

           

          Thanks for using Tableau!

          Angie

          • 2. Re: Business Day Number
            Tapiwa Sunde

            Thank you for you response,

            The responses I am getting are different ways of calculating total business days in a month, what I want is a calculated field showing , for example 1st  business day in June was on the first and in July it was on the 3rd, these 2 dates are the first business days and I want to compare them on the line graph, so irregardless of the calendar day I should be able to pull the business day and compare say the 5 th business day in May against the 5th business day in June and 5th business day in July.  The calculations I am getting from the blog are Measures, I do not need that I dates such as the calendar dates I have on the attached except I will be counting just the business days

            • 3. Re: Business Day Number
              Asher Campbell

              Hey Tapiwa,

               

              The best way I can think of doing this is to utilize the calculation for number of business days.  The use is going to calculate the number of business days from the start of the month to the date field in question.  So, your example of Jun 3 would calculate the number of business days between Jun 1 and Jun 3... 2.  Which is the desired result.  This calculation is:

               

              DATEDIFF("weekday", DATETRUNC('month', [Order Date]), [Order Date])

                  - 2 * (DATEPART('week', [Order Date]) -DATEPART('week', DATETRUNC('month', [Order Date])))

                  + (IF DATENAME('weekday',[Order Date]) = 'Saturday' OR DATENAME('weekday',DATETRUNC('month', [Order Date])) = 'Sunday'

                  THEN 0 ELSE 1 END)

               

              Note: this is from the attached workbook using Superstore, simply replace the [Order Date] with whichever date field you want to convert.

              1 of 1 people found this helpful
              • 4. Re: Business Day Number
                Bhavesh Jaisinghani

                Hi Tapiwa Sunde,

                 

                You can join workday dim to your existing datasource where

                - You will be able to sum(Working Days)

                - Pinpoint Workday Number

                 

                Attached is sample Worday Dim Table.

                • 5. Re: Business Day Number
                  Tapiwa Sunde

                  Thank you Asher this worked for me!!!