1 Reply Latest reply on Sep 15, 2016 8:32 AM by David Li

    Calculated field to display Year instead of year number

    ravi.chaliki

      Hi Gurus,

       

      I have one question to help me with using Calculated fields. I have the following data:

       

      Year Number
      Amount
      Year 1100
      Year 2200
      Year 3300
      Year 4400
      Year 5500
      Year 6600

       

      Once displayed in Tableau, I want the Years to be displayed as 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025 etc,

       

      Can I do it using a lookup table to map the Year number and Actual Year?

       

      Cheers,

      Ravi.

        • 1. Re: Calculated field to display Year instead of year number
          David Li

          Hi Ravi! You could display the years in that way by using a table calculation:

          2017 + FIRST()

          Make sure that computes on Table (Down) or along [Year Number]. If you don't want to hardcode the first year, you can create a parameter to hold it.

           

          You also have other options. For instance, you could create a lookup table and use it as a blended secondary data source. You could also set [Year Number] to be a string and edit its aliases.