11 Replies Latest reply on Mar 11, 2018 10:00 AM by Deepika Goyal

    Create dropdown date parameter

    Deepika Goyal



      I am creating a design which compares two months sales number hence have created two parameter start and end date based on the sales date column.


      Now, these dates parameter has sliders, I require drop-down functionality for the user to select any month they want.


      Also, this parameter I have dragged to the dashboard but I cant see the option of using this as a filter for the selected worksheet like the one appears in normal filters.


      can anyone please help in this.




        • 1. Re: Create dropdown date parameter
          Jim Dehner

          Good morning


          without seeing your workbook I think you created your parameters using the Range" radio button

          see below





          If you edit the parameter and use the List radio button it will change the parameter as shown below







          Then when you open it it will give you a drop down





          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.

          • 2. Re: Create dropdown date parameter
            Zach Leber

            Hi Deepika, select your sales date field and create two date parameters from it. Change their formatting to custom "mmm yyyyy" to get them to months, okay the warning about repeat values.

            month parameter.png

            Then add your sales date to the filter shelf, change it to discrete, and add a condition that compares the month of the date with your two parameters.

            month filter.png


            Final view could look like the following:

            month results.png




            P.S. Tableau 10.3 TWBX attached.

            1 of 1 people found this helpful
            • 3. Re: Create dropdown date parameter
              Deepika Goyal



              Thanks for you reply.


              I tried using your solution but it's throwing me an error " The formula should be aggregate calculation or refer only to this field "


              Can you please help. Your workbook is also not opening.





              • 4. Re: Create dropdown date parameter
                Zach Leber

                Try filtering on Month instead of MONTH(Month). You can still show MONTH(Month) in your view.


                Tableau Desktop 10.3 or higher will open the 10.3 TWBX I attached.


                Your example shows a range of months, in that case change the Filter Condition to:


                DATETRUNC('month', [Order Date])>=

                DATETRUNC('month', [Order Date 1])


                DATETRUNC('month', [Order Date])<=

                DATETRUNC('month', [Order Date 2])


                Please extract some of your data into a packaged workbook and attach a TWBX if you are still having trouble.

                • 5. Re: Create dropdown date parameter
                  Lalitha B

                  Hi Zach,


                  I tried the solution provided and it worked for me only when filter is on Individual Dates as shown in the below screenshot.


                  Initially I tried using month option but it thrown error as mentioned by @Deepika in the previous reply.


                  I would like to know the reason why it works only with "Individual dates" option but not other options provided.


                  Thanks in advance




                  1 of 1 people found this helpful
                  • 6. Re: Create dropdown date parameter
                    Zach Leber

                    Hi Lalitha, in your list, the top two choices are green (continuous) which is why they don't work, and all the other choices convert the date to a datepart that you can't reference in the condition. But it's not a limitation, as you can use DATETRUNC or DATEPART in the Filter Condition to round the exact individual date any way you want (as in my example), and you can still set the date rounding in the view (also in my example). Regards, Zach

                    • 7. Re: Create dropdown date parameter
                      Zach Leber

                      Thank you Lalitha for pointing out that you need to select "Individual Dates" to use the filter condition I showed, I neglected to mention that and you can't tell from either my pictures or workbooks that that's what you have to do to set things up.

                      • 8. Re: Create dropdown date parameter
                        Zach Leber

                        Hi Deepika, back to your original requirement of providing drop-down menus for start and end, there's no way to do that without parameters. Nor can you show two separated months as in my first example. But a big downside of parameters for dates or any dynamic dimension is that they don't update with the correct choices for the latest data if you have live data. That's why filters are nice. I attached an example that uses a built in range filter on continuous MONTH(date). I agree that it's harder to choose the date with a slider than with a menu, but I found it handy that you could click the date and type the month/year which is even faster. I attached MonthBook3.twbx (10.3) which has all three examples posted above. Regards, Zach


                        • 9. Re: Create dropdown date parameter
                          Deepika Goyal

                          Hi Zach,


                          This worked for me!! Thanks a lot.


                          One thing, the dates we are showing in the paramter, after converting them to the customer (mmm yyy) they are not appearing in the order.


                          Also, i have to create one simple chart based on date1 and date option


                          Sales on Date1, sales of date2,  MOM comparison ( perc)

                          I tried the option of table calculation  but its not returning me all the three columns.


                          Any suggestion on this?





                          • 10. Re: Create dropdown date parameter
                            Zach Leber

                            You're welcome Deepika. Please mark some of the comments as helpful or correct and the question as resolved.


                            If the dates in your data source are not sorted, you can copy them to Excel, sort them there, and then paste them back into the parameter creation screen using the Paste from Clipboard option.


                            How do you want to display a third column that is a percent difference next to two columns that show sales? I've attached one example using a dashboard to show two different views next to each other, you could format that further. I needed to manually edit the axis limits and colors to make it work at all. I don't think it's the right way to display the data because your percentages could be even larger, e.g. 200% so how do you notice that vs. 100% without making the axes 500%?


                            If you are only comparing two months of sales that are represented by bars, you don't need any additional graphics, as there's no better visual comparison than two bar lengths. Maybe just add a numerical percent label, like this, which also works well when you are displaying more than two months.



                            • 11. Re: Create dropdown date parameter
                              Deepika Goyal


                              I am not able to export your workbook,  using 10.2.


                              Is there any workaround for sharing the workbook.