1 Reply Latest reply on Aug 25, 2016 11:19 AM by Stoyko Kostov

    Showing years x+1 and x+2 in the columns when selecting year x in the row

    Anthony Somma

      I'm trying to get tableau to show me the data for the next two years out when selecting a year.

      So if I select 2016 as "booked year" which is the row then I'm looking to see 2017 and 2018 as "flow year" which is in the columns

      If 2017 then 2018 and 2019, etc.


      How would I do something like this?

        • 1. Re: Showing years x+1 and x+2 in the columns when selecting year x in the row
          Stoyko Kostov

          Hi Anthony,


          I assume you have some kind of Date field in your data. Move that Date field to Columns, and choose YEAR(Date). Organize your remaining rows and columns per your requirements.


          Now you can proceed as follows: Create a parameter called Year, and choose Data type Integer, and current value something that makes sense for your data.

          Click on the parameter, choose Default Properties - Number Format, then choose Number (Custom), and deselect Include thousands separators and set decimal places to 0. (This is so you make it appear like a year, e.g. 2015, and not 2,015).

          Click on the parameter again, choose Show Parameter Control.


          Now move that same field Date to Filters, choose Years, then Condition - By Formula, and enter the following formula:

          YEAR(MAX([Date]))>=[Year] AND YEAR(MAX([Date]))<=[Year]+2

          (In this formula, [Date] is the field you want to filter and [Year] is the parameter you just defined).


          This should solve your problem. Watch how changing the parameter changes your columns.

          Let me know if you have more questions.