4 Replies Latest reply on Nov 26, 2018 6:07 AM by Paul Wachtler

    Time datatype

    Agil Visaakan

      Hi team,

       

      From datasource iam having column as TIME but tableau not capable to get type only datatype it gets time along with DATETIME datatype.

      So,i split up time from DATETIME and stored as string in one calculation and changed it to continuous to show this values in bar chart.So, showing time values in barchart is successfull.

      NOW,

       

      I want to show values in bar chart as conditional colouring.

      How to do that?

        • 1. Re: Time datatype
          Paul Wachtler

          Hi Agil,

           

          If you drop the measure that you want to color by onto your color shelf you can color either as a continuous measure (in which you'll get a color scale) or as a discrete measure in which each value gets it own distinct color.

           

          Let me know if you have any questions.


          Best,Paul

          • 2. Re: Time datatype
            Agil Visaakan

            Hi paul,

             

            If i put into colour shelf means we can assign various colours.But i want to put those colours permanent as a condition for future data also.

            Eg,

            I am having three different softwares i want to track those softwares running time

             

            Software 1 - 03:00:00

            Software 2- 09:00:50

            Software 3- 04:00:00

             

            Here i want to track in which software taking above 8 hours means it should show as red in colour,Software which is in between 4-8 hours should show green in colour,Software which is below 3 hours means it should shows green in colour?

             

            Are you clear with my question?

            • 3. Re: Time datatype
              Zhouyi Zhang

              Hi, Agil

               

              It will be easier for people to provide a solution if you could share a sample workbook.

               

              ZZ

              • 4. Re: Time datatype
                Paul Wachtler

                Hi Agil,

                 

                If you want to color based on ranges within the running time field then you can create a calculated field like this (replace the name of the running time field with whatever it's actually called).  Also, did you mean to have both the 4-8 hour range and below 3 hour range as green?  I believe you want the 4-8 hour range to be yellow, but if not, you can adjust that as well.

                 

                if sum([running time]) > 8 then "Red"

                elseif sum([running time]) > 4 then "Yellow"

                else "Green"

                end

                 

                Drag that onto your color mark and adjust the colors so that "Red" is red, "Yellow" is yellow, and "Green" is green.

                 

                Best,

                Paul