7 Replies Latest reply on Aug 29, 2016 11:56 AM by saurabh.c.0

    Date parameter

    saurabh.c.0

      I am working with date parameters and currently I have a start and end date parameter which are working by placing the below calc on the filter shelf and setting it to true

      [Reporting Date]>=[Parameters].[Start Date] and [Reporting Date]<=[Parameters].[End Date]

       

      Now the requirement is to provide a way to end user to select a fiscal year on dashboard and

      if its 2016 then filter the reports for june 2015 to May 2016 .

      if it is 2017 then filter the reports for june 2016 to May2017

       

      How to achieve this?

        • 1. Re: Date parameter
          David Li

          Hi there! You should be able to do this by creating an integer parameter for your fiscal year and then using this calculated formula like this as a filter:

          [Reporting Date]>=MAKEDATE([Parameters].[Fiscal Year]), 6, 1) AND [Reporting Date]<MAKEDATE([Parameters].[Fiscal Year]+1, 6, 1)

          Since the fiscal year always starts on the same date, we can just construct a the dates.

          • 2. Re: Date parameter
            Kathryn Bridges

            Hi!

             

            Not sure if I'm completely understanding or not, but if your Parameter is "Fiscal Year" (i.e. 2015 or 2016), then instead of your initial calculation, I would MAKEDATE(1,1,[Parameter Year]), and then put the following on the Filter Shelf:

            (If [ReportingDate]>=(DATEADD('month',-7,MAKEDATE)) AND [ReportingDate]<=(DATEADD('month',4,MAKEDATE)) then [ReportingDate] else null end)

            Hope this helps!

            • 3. Re: Date parameter
              saurabh.c.0

              Hi David and Kathryn,

                      Your logic worked. By default,I am able to see the months according to the selected fiscal year. But now the client also needs the ability to select only few months in that fiscal year. so we need another filters to over ride the default setting. Kindly suggest.

              • 4. Re: Date parameter
                David Li

                You can add a separate filter that filters on the month names (not month values). That is, if you right-click and hold and drag the date field into the filters, then select "Months" as shown here:

                 

                Then, the client can filter specific months if you add a quick filter to your sheet/dashboard.

                • 5. Re: Date parameter
                  saurabh.c.0

                  Thanks for quick response.The problem is , I need to make it work as global filter as I will be having sheets coming from different sources once its placed on dashboard. That's why I am using parameters. But with what we have done so far, we already have a Parameter which is doing the initial filtering based on fiscal year. How can we have another parameter to override

                  • 6. Re: Date parameter
                    David Li

                    Do you have the option to go to Tableau 10? If so, you can use cross-data source filters.

                    • 7. Re: Date parameter
                      saurabh.c.0

                      Currently , I do not have that option