4 Replies Latest reply on Aug 29, 2018 11:17 AM by Kenneth Holt

    Gantt Charts and Persistent Events/Schedules

    Kenneth Holt

      Hi Everyone,

       

      I've got a great maintenance geared gantt chart, shows exactly what the users are looking for, with the exception of persistent events with a Start Date/Time prior to the current view.

       

      Views are based on the exact and continuous Event Start Dates

      Ex. There is a maintenance starting Monday at 00:00 and ends Friday at 06:00.

       

      * Looking at the 'This Week' (Range of Dates) filter will display all maintenances starting this week, but fails to show items when are in progress from the prior week

      - I realize why I cannot see events prior to 'This Week', its the filter setting

      A maintenance Gantt Chart, beyond a weeks worth of data, becomes a convoluted mess

       

      * Changing the Range of Dates filter to Yesterday, Today, or Tomorrow does show all events starting on those days

      - As you've guessed, any persistent events which span multiple days do not appear

       

      Is there a (easy) way to show events which are starting on the day being viewed and maintain visibility of persistent events which encroach while using This Week, Yesterday, Today, and Tomorrow?

       

      Thanks,
      Ken

        • 1. Re: Gantt Charts and Persistent Events/Schedules
          ArseneXie

          Hi Kenneth,

           

          Assume that there are [Event start], [Event Time] fields for each event.

          And a parameter [Range of date] to determine what data to be displayed. 

           

          This depends on the definition of every [Range of date]:

          A.  [Range of date]='Today/Yesterday/Tomorrow', only shows events which start day is Today/Yesterday/Tomorrow

          B.  [Range of date]='this week', shows events which  start day in this week, or start before this week but end in(after) this week.

           

          I will create some calculation fields.

           

          1. Create a CF [Event End] :

               [Event Start] +  [Event Time]

           

          2. Create a CF [In the Range]:

               If [Range of date] = 'today' THEN

                     DATE([Event start]) = TODAY()

               else if [Range of date] = 'yesterday' THEN

                     DATE([Event start]) = TODAY()-1

               else if [Range of date] = 'tomorrow' THEN

                     DATE([Event start]) = TODAY()+1

               else if [Range of date] = 'this week' THEN

                     ( DATE([Event start]) >= DATETRUNC('week',TODAY())  AND DATE([Event start]) < DATETRUNC('week',TODAY())+7

                     OR 

                     (DATE([Event End]) >= DATETRUNC('week',TODAY()) AND   DATE([Event start]) < DATETRUNC('week',TODAY()) )

           

          3. Put [In the Range] = TRUE into the filter

           

           

          The algorithm of 'This Week' :

            

          • 2. Re: Gantt Charts and Persistent Events/Schedules
            Kenneth Holt

            Hi ArseneXie,

             

            Thank you for the quick reply.  Unfortunately, due do my inexperience with Tableau, I'm unable to get your suggested expressions to work.  I've packaged up a sample data pack, I hope this helps a bit.

             

            What you've illustrated does show what I'm attempting to accomplish.  I threw in 'Big Maintenance Sample' with an 60+ day duration.  I also created week long duration events for each week of the data set.

             

            I've got the following workbooks included:

             

            All

            This Week

            Yesterday

            Today

            Tomorrow

             

            Thank Again,

            Ken

            • 3. Re: Gantt Charts and Persistent Events/Schedules
              ArseneXie

              Hi Kenneth,

               

              It could only provide simple function with the default filter functions.

              I try to implement this in the tab 'Using Parameter'.

              (As attach, my tableau version is 2018.2, I export another attach in version 10.5 in case the version issue.)

               

              1. Create a parameter:  Range of date

               

               

              2. Create a calculation field : In the Range, which return TRUE or FALSE

               

              If [Range of date] = 'Today' THEN

                  DATE([Event Start]) = TODAY()

              ELSEIF  [Range of date] = 'Yesterday' THEN

                  DATE([Event Start]) = TODAY()-1

              ELSEIF [Range of date] = 'Tomorrow' THEN

                  DATE([Event Start]) = TODAY()+1

              ELSEIF [Range of date] = 'This Week' THEN

                (DATE([Event Start]) >= DATETRUNC('week',TODAY())  AND DATE([Event Start]) < DATETRUNC('week',TODAY())+7 )

                        OR

                  (DATE([Event End]) >= DATETRUNC('week',TODAY()) AND  DATE([Event Start]) < DATETRUNC('week',TODAY()))

              END

               

               

              3. Drop In the Range  into filter with TURE condition only

               

               

              4. Now it will work with the algorithm according to the value of the parameters.

               

              5. If your week start day is not Sunday,

                You can right click the data source, choose date property, and change the start day of the week.

               

               

              Arsene

              • 4. Re: Gantt Charts and Persistent Events/Schedules
                Kenneth Holt

                Hi ArseneXie,

                 

                Thank you very much!  I was able to take what you wrote and expand a little to show persistent events with all views, as well as create another one

                There is no way I would have figured out how to do this on my own.

                 

                Also, thank you for pointing out how to universally set the Date Format, was so lame customizing every Dimension

                My Favorite is 'DDD, MMM DD, YYYY HH:MM'

                 

                Sincerely,

                Ken

                 

                T/F Range of Date

                //T/F Range of Date

                 

                If [Range of Date] = 'Today' THEN

                DATE([Event Start]) = TODAY()

                OR

                (DATE([Event End]) >= DATETRUNC('day',TODAY()) AND  DATE([Event Start]) < DATETRUNC('day',TODAY()))

                 

                ELSEIF  [Range of Date] = 'Yesterday' THEN

                DATE([Event Start]) = TODAY()-1

                OR

                (DATE([Event End]) >= DATETRUNC('day',TODAY()-1) AND  DATE([Event Start]) < DATETRUNC('day',TODAY()-1))

                 

                ELSEIF [Range of Date] = 'Tomorrow' THEN

                DATE([Event Start]) = TODAY()+1

                OR

                (DATE([Event End]) >= DATETRUNC('day',TODAY()+1) AND  DATE([Event Start]) < DATETRUNC('day',TODAY()+1))

                 

                ELSEIF [Range of Date] = 'This Week' THEN

                (DATE([Event Start]) >= DATETRUNC('week',TODAY())  AND DATE([Event Start]) < DATETRUNC('week',TODAY())+7 )

                OR

                (DATE([Event End]) >= DATETRUNC('week',TODAY()) AND  DATE([Event Start]) < DATETRUNC('week',TODAY()))

                 

                 

                ELSEIF [Range of Date] = 'This Month' THEN

                (DATE([Event Start]) >= DATETRUNC('month',TODAY()))

                OR

                (DATE([Event End]) >= DATETRUNC('month',TODAY()) AND  DATE([Event Start]) < DATETRUNC('month',TODAY()))

                END