2 Replies Latest reply on Aug 24, 2018 1:12 PM by morton hsiao

    How can I drill by dates to show all of 2017 as one group and 2018 by months

    morton hsiao

      I have no clue what a viz link is.

        • 1. Re: How can I drill by dates to show all of 2017 as one group and 2018 by months
          Ben Neville

          A little light on details, but I think you might want to create a standard hierarchy... there are knowledge base articles about how to do that. Your first calculation/highest level in the hierarchy would be called Year and would contain
          YEAR([YourDateFieldHere])

           

           

          Your next level in the hierarchy would be Month (or Month/Year), and would read:

          IF YEAR([YourDateFieldHere]) = 2018 THEN MONTH([YourDateFieldHere])

          ELSE YEAR([YourDateFieldHere])

          END

           

          If you're not talking about drilling down in the true sense, and you just want to have a bar/mark for 2017 displayed next to monthly 2018 marks, you can probably just use this calculation on its own.

           

          Alternatively, you might want to show the month name instead of the number, in which case you will need to use

          IF YEAR([Order Date]) = 2018 THEN DATENAME('month',[Order Date])

          ELSE STR(YEAR([Order Date]))

          END

           

          Finally, make sure you sort this Ascending by [YourDateFieldHere]  either Minimum or Maximum. This should ensure your values appear in the correct order.

           

          If that's not clear or doesn't answer your question, perhaps you could give us a bit more context.

          • 2. Re: How can I drill by dates to show all of 2017 as one group and 2018 by months
            morton hsiao

            I think you know exactly what I want.  You can do this in excel because there's a little plus everywhere, but then you can't do it here in the same manner.  Since this is my first real day making graphs in Tableau, I can't say for sure, but generally tableau deals with these mixed cases with formulas it seems.