1 Reply Latest reply on Nov 1, 2018 8:08 AM by Jim Dehner

    Dynamic filter bounds based on two parameters

    Ian Donnelly

      Apologies if this has already been answered, but I've searched for a while and have been unable to find an answer. I have a set of data that displays cost against different schools, increasing every year for 8 years (2010-2018). I want to project this data into the future, but there's a few catches.

       

      1) I want to choose the start year. So for example, I want to select a start year of 2025, or somewhere else in the projected data.

       

      2) I want to choose if the projection will display 4 or 5 but only 4 or 5 years into the future based on my start year.

       

      I know how to do projections, but I'm stumped if I should do this with parameters, calculated fields, or a combination, or something else entirely. An idea that I've had would be to add the "Year" Dimension as a filter, with some sort of calculation that takes the user-inputed Start Year and Number of Years and defines the filter parameters off of that, but I cannot figure out a way to do it.

       

      I also could see if I can't do this with projected data, and need to calculate that on my own before I can do that. Even if I do though, I'm still stumped on how to create the dynamic filter bounds.

       

      Any help is greatly appreciated. Thank you!

        • 1. Re: Dynamic filter bounds based on two parameters
          Jim Dehner

          Good morning

          would like to see your twbx workbook with the data to give you a more specific response -

          but in concept there are a couple of considerations - first parameters are the way users input single values into tableau - the parameter on its own does nothing - it must be included in a calculated field or a filter to affect the viz and finally they are static and global - i.e. the don't change until the user changes them and they are constant across the entire book

           

          Filter filter data out of the vis - so if the plan is to projet the future based on the past you need the full range of data - sounds like filters are not the way to go

           

          set up your 2 parameters - one on date that includes the full range of data (actual and projection) in the data and the second an integer theat includes the years (4 or 5 from you post) and use date functions like dateadd to do do your calculations based on date

           

          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.