5 Replies Latest reply on Nov 3, 2017 12:17 AM by Tushar More

    Set filter on latest date when workbook open

    Vinay Nrandralal

      Dear all,

       

      Please see attached file.

       

      I would like to do two thing!

       

      1, How to set Filter (Date Filter) on latest date when the
      workbook open.

      1. Sort the Filter (Date Filter) on Descending order of
        date.

       

       

      Please help me out.

       

      Thanks

      Vinay

        • 1. Re: Set filter on latest date when workbook open
          Zhouyi Zhang

          Hi, Vinay

           

          If you could try some later version rather than 10.2, Tableau has such feature as shown below to meet your requirement

           

           

          ZZ

          • 2. Re: Set filter on latest date when workbook open
            Tushar  More

            Hi Vinay,

             

            If you are using version before 10.2 then the below thread will give the solution.

            Help required to set dashboard filter automatically with the current month

             

            Hope this helps.

             

            ~Tushar

            1 of 1 people found this helpful
            • 3. Re: Set filter on latest date when workbook open
              Vinay Nrandralal

              HI,

               

              I am using 10.2 so i can't use ZHANG suggestion.

               

              Hi Tushar,

              I have tried your solution and  its work, Thanks

               

              But how do I  sort date filter in decending order (like in screen shot below i want latest date  (4 November 2017) first.

               

              Regards

              Vinay

               

              • 4. Re: Set filter on latest date when workbook open
                Tyler Garrett

                Depending on the datasource, I would recommend date functionality handled in the SQL.

                 

                Use a subquery in your select statement with Date.

                 

                Select column1,

                (select max(date) from table1) as column2,

                from table1

                 

                This offers a replacement to max{date} LOD bracket thingy. Which is one of the slowest LOD calcs in the application, due to the nature of the sql - it's rad, but very slow. Ergo, above calc replaces that completely.

                 

                If it's in excel, utilize native functions in Tableau or in your excel workbook.

                 

                Here's a copy and paste from functions page. This will help you with opening your workbook and pushing your filters around to fit your need. I always recommend building it internally, then build the JOB in your data source to only offer you the right data when you need it. (otherwise you're just pulling tons and tons of data, which will slow down the user experience)

                MONTH(date)

                Returns the month of the given date as an integer.

                Example

                MONTH(#2004-04-15#) = 4

                NOW( )

                Returns the current date and time.

                The return varies depending on the nature of the connection:

                • For a live, unpublished connection, NOW returns the data source server time.
                • For a live, published connection, NOW returns the data source server time.
                • For an unpublished extract, NOW returns the local system time.
                • For a published extract, NOW returns the local time of the Tableau Server Data Engine. When there are multiple worker machines indifferent time zones, this can produce inconsistent results.

                Example

                NOW( ) = 2004-04-15 1:08:21 PM

                TODAY( )

                Returns the current date.

                Example

                TODAY( ) = 2004-04-15

                YEAR (date)

                Returns the year of the given date as an integer.

                Example

                YEAR(#2004-04-15#) = 2004

                 

                Functions are hard to memorize or get much out of the functions page indexed for Tableau. Enters my little dashboard - So use this dashboard instead. It will help you with the above functions in a user friendly format. Hope it helps, I used to use it daily.

                 

                Cheers,

                Tyler

                Dev3lop.com

                1 of 1 people found this helpful
                • 5. Re: Set filter on latest date when workbook open
                  Tushar  More

                  Hey Vinay,

                   

                  You can apply manual sorting. In the Dimension pane, right click the date field, Default Properties> Sort>Manual sort.