1 Reply Latest reply on Mar 28, 2018 7:38 AM by janie neff

    Create a new Dimension

    janie neff

      Hi,

      I'm trying to create a new field in my Tableau workbook. I have written the following as a calculation to show what data is being compiled in order to create my new field called 'Month'. Do I need to create a Set or a Group in order to get this new field called 'Month'?

       

      if [As of Date] = '1/31/2018' and [Org Year] = 2018 and [Org Month] = '1' then 'Jan'

      if [As of Date] = '2/28/2018' and [Org Year] = 2018 and [Org Month] = '2' then 'Feb'

      if [As of Date] = '3/31/2018' and [Org Year] = 2018 and [Org Month] = '2' then 'Mar'.....

       

      Thanks!

      Janie

        • 1. Re: Create a new Dimension
          Jim Dehner

          Hi Janie

           

          How did it work when you applied the calculation in your viz?

           

          When you created a calculated field in tableau it is  adding a column to the underlying table that supports each viz (like a column in an excel spreadsheet)

          you formula will place a value "Jan" etc in the field of that chart that corresponds to the condition in your IF statement AND a NULL in any field that does not meet any of the conditions (if that makes sense)

          So now to your question - you don't need to create a set - you have "Tagged" each record (think row) that met the condition -  so if you drag Month to the viz it will work as if you created a group --- you can use MONTH in calculations, filters etc

           

          Jim

           

          If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

          1 of 1 people found this helpful