Since the version 2020.1, Tableau has a new dynamic parameter feature that solves a long standing problem: Making a date range filter with end date default to the max date in the data source.

Here is how it works:

1.Create a field Max Date = {Max(Order Date)}

2.Create a parameter End Date as follows. Set value when workbook opens to be the above Max Date.


3.Create your regular Start Date parameter and a date range filter

Here we got an example workbook for you to download. It will always open to the last date of the data set as the End Date.

Update: I found an issue when working with data extract on server. The solution is 

  1. Create a local copy of the extract.
  2. Create Max Date and publish data extract to the server along with the field.
Then the dynamic parameter works.


5

View comments

  1. Good post! I have one question: I have a workbook. The data is refreshed every year at Jan 5. With the dynamic parameter and the method you introduce in this post, I can always show the Jan 5 of latest year as the default parameter value. That's good. However, if I want the parameter only show the Year, no month and date, how can I set the parameter? For example, if the latest date is Jan 5 2019, I want the default parameter shows 2018, which means it is 2018 data. If the latest date is Jan 5 2020, I want the default parameter shows 2019. Formerly with static parameter, I can input different data for value and display. For example, I can set the value as Jan 5, 2020, and the display as 2019. But with dynamic parameter, I cannot do in such a way. Thanks for help!

    ReplyDelete
    Replies
    1. Specific to your case, create a field like this instead MaxDate: MaxYear = Year( {Max(Order Date)}) -1
      Or MaxYear=Year(DateAdd('day',-5, {Max(Order Date)})) Give it a try and let me know if this works.

      Delete
    2. And "End Date" should be "End Year". Date Type is either Date or Integer.

      Delete
  2. Is there a way to have a [Start Date] and [End Date] parameter filters as a field where the user can manually enter data or select from a calendar (so it would be the range option instead of list), AND have the [End Date] default to the latest date? I know we would need to use the "Range" section when we edit the parameters, but curious if there is a way to have the end date as the latest date by default but the user would be able to select other dates if they wanted to

    ReplyDelete
    Replies
    1. Yes you can. Any of the 3 options will work: All, List, and Range.

      Delete

(Refresh the page if you want to view the gif image multiple times. Or go to Tableau Public and click the button at the top-right corner.)

Jake and I collaborated on a dashboard. He told me that he learnt a way to create an in-place help page in Tableau. He first saw it at a conference somewhere and couldn't recall who the speaker was. So I am blogging here about it but the credit goes to somebody else. If anyone knows who the original creator is, leave a comment below.

The key idea is to float a semi transparent worksheet on top of the dashboard, where a help text box is strategically placed on top of each chart. This way, we can explain how to view each chart and what data points are important, etc. This worksheet is collapsible by a show/hide button. 

Below I would like to show how this worksheet can be constructed.

1. Sheet with a single data mark.

  • Double click the empty space in Marks panel and add two single quotes. Make the null pill a text label. This creates a single null mark.
  • Set the view as "Entire View"

2. Create an show/hide button

  • Go to the target dashboard
  • Drag a floating vertical container to the dashboard, making it cover all the area of interest.
  • Drag the Single Null Mark sheet and drop it into the above container. Hide the sheet title.
  • Create an open/close button for the container and place the button at the top-right corner.

3. Add annotations

  • Format the sheet background opacity as 70% in the layout manager             
  • Select area annotations and place them anywhere of interest. 
  • Write help text and format it to highlight important messages.  
  • The text can serve as functional guide and/or insight guide.

Here is an example. Feel free to download the workbook and explore. Click the "i" button at the top-right corner to view the in-place help. 

0

Add a comment

Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.