3 Replies Latest reply on Oct 17, 2018 2:23 PM by Pamela Lee

    Display Format for Quarter is Incorrect in Viz

    Pamela Lee

      Hi There!

       

      I have a training viz that has a parameter that allows the user to select Year, Quarter or Month in the viz.  It works fine, but the format for Quarter shows 1, 2, 3, and 4 instead of Q1, Q2, Q3, and Q4.  I can manually change them, one at a time, by right clicking and choosing Edit Alias but I'd rather that it automatically defaults to the Q1, Q2, Q3, and Q4 values.   How might I do that?

       

      Thanks!

       

      Pamela

       

        • 1. Re: Display Format for Quarter is Incorrect in Viz
          Jeff Strauss

          Hi Pamela.  One way to handle this is to create a calc which can say something like this and then drag this onto your column shelf.

           

          case Parameter

           

          when "Quarter" then "Q" + existing field

           

          when other then existing field

           

          end

          • 2. Re: Display Format for Quarter is Incorrect in Viz
            Pamela Lee

            Hi Jeff and thanks for the response.  I agree, I could create a calc to change the value, but I was thinking along the lines of changing a configuration setting somewhere in Tableau that would set it to Q1, etc. for all worksheets/books. 

             

            The reason I'm leaning toward a configuration setting is that a co-worker has the same worksheet/book and the Quarter values are correctly formatted on her laptop in her version of Tableau.  We went through the components that drive the parameter and couldn't find any differences, so we are both stumped.

             

            Thanks!

             

            Pamela

            • 3. Re: Display Format for Quarter is Incorrect in Viz
              Pamela Lee

              We figured it out!  There was a difference in one of the components.  My coworker had a CASE statement in her calc and I did not.  I changed my calc to the CASE statement and viola, Quarters are now correctly formatted! 

               

              Here's the code for both for comparison:

               

              CASE [Select a Date Level]

              WHEN "year" THEN DATENAME('year', [Order Date])

              WHEN "quarter" THEN DATENAME('quarter', [Order Date])

              WHEN "month" THEN DATENAME('month', [Order Date])

              END

               

              DATENAME([Select a Date Level],[Order Date])

               

              Thanks!

               

              Pamela