7 Replies Latest reply on Oct 19, 2016 9:34 AM by Rahul Patel

    How do I hide weekends on a gantt chart?

    Ben Sullivan

      Hi,

       

      I have a gantt chart showing progress against a set of deliverables over time. Each has a start date, a finish date, and a calculated field to determine the length of the bar on the gantt. If you look at the image below you'll notice that there are many gaps between 'tasks' (line items) due to weekends. If a task starting Friday ends Monday, the task appears to go through the weekend but if the task ends Friday and a new one starts Monday, it leaves a gap. While this isn't inaccurate it's not ideal visually (producers keep asking me "what are these gaps?").

       

      Is there a way to modify the date axis to hide weekends? Take a look at my setup below. I don't want to hide tasks that happen to go over the weekend, I just want the visually condensed as if going straight from Friday to Monday.

       

      Clipboard02.jpg

        • 1. Re: How do I hide weekends on a gantt chart?
          Tom W

          Your DAY(start) pill on the columns shelf is continuous. You'll need to switch that to discrete.

          Then drag your date to the filters shelf, select weekday and exclude Saturday / Sunday.

          • 2. Re: How do I hide weekends on a gantt chart?
            Ben Sullivan

            Hi Tom, thanks for the reply!

             

            I don't think this will give me what I'm looking for though. Switching the Day(start) to discrete gives me a very different view, and the gantt chart no longer works as intended (gantt views require a continuous date field according to 'show me').

             

            I also don't want to filter on start date (nothing would start on a weekend anyway). I just want to change the date axis to hide Saturday and Sunday on the axis, such that a task starting on Friday and a task starting on Monday would appear without a gap between them.

            Clipboard01.jpg

            • 3. Re: How do I hide weekends on a gantt chart?
              pooja.gandhi

              Ben,

               

              You could actually right click the date field in the dimensions pane as highlighted below and click create custom date. You can choose 'weekday' in the pop up that opens. A new dimension called "order date (weekday)" is established which you can bring to filters and click show filter. Uncheck the weekends and you should have your continuous date field untouched.

               

              Hope this makes sense.

               

              Capture.PNG

              • 4. Re: How do I hide weekends on a gantt chart?
                Ben Sullivan

                Thanks for the response Pooja! That looks like what I'm after, but I don't have the 'transform' option when I right-click th start date. It's a "Date & time" data type and it's coming from a MySQL DB. What version of Tableau are you using (some icons look different)?

                • 5. Re: How do I hide weekends on a gantt chart?
                  pooja.gandhi

                  Oh thats right. I am on version 9. If you are on earlier versions, you should be able to right click the date/time field and select 'create custom date'. There is no transform option for earlier versions.

                  • 6. Re: How do I hide weekends on a gantt chart?
                    Ben Sullivan

                    Thanks for the update - I was able to go through your suggestion in Tableau 9 (wanted to update anyway!).

                     

                    Unfortunately I don't want to filter items with a start date on the weekend (there are none). I want the axis to not show Saturdays and Sundays. An item on Friday and an item on Monday shouldn't have a gap between them in the gantt view. Similarly, an item that starts Friday and ends Monday should only appear to be 2 days long in this view.

                     

                    So to be clear, I don't want to filter any items based on start date. I only want the axis to show weekdays:

                    Monday 1st, Tuesday 2nd, Wednesday 3rd, Thursday 4th, Friday 5th, Monday 8th, Tuesday 9th

                    ^ The 6th and 7th aren't filtered, they just aren't represented on the axis.

                     

                    Does that make sense? Maybe what I'm asking for is unusual.

                    • 7. Re: How do I hide weekends on a gantt chart?
                      Rahul Patel

                      Thanks Pooja. That was exactly what I have spent a couple hours searching for. Simple and clean.