Search code examples
filterdropdowntableau-apidashboard

Tableau: How to restrict a dropdown filter to fields that start with "2021*" (a fiscal week field that adds a new field weekly)?


I need an automatic way to have new fiscal weeks (a string that looks like yyyyww) added to my dropdown filter. It's necessary that it's a dropdown unfortunately. Can I just filter out all values that don't start with "2021*" in this particular table? I use those other values in other parts of my dashboard, so I can't filter them out of my data completely. enter image description here


Solution

    1. Create a calculation called DateDisplay as follows:

      IF STARTSWITH((STR([Period])),'2021') = TRUE then 'Display' END

    2. Add the new DateDisplay field to the Filters Shelf and uncheck NULL

    3. Select 'Show Filter' for the string date field

    4. On the drop down menu (down arrow on the right) for the filter which is now showing, select the options 'Only Relevant Values'

    enter image description here