tableau / extension-date-updater

Automatically update your date parameters to today's date.
https://tableau.github.io/extension-date-updater/
MIT License
8 stars 16 forks source link

Feature Request #27

Closed davidihernandez closed 4 years ago

davidihernandez commented 4 years ago

Is it possible to implement the date update to update based on a date field in the data source? I love using the calendar picker and it's a much better UX than single select drop-down, but my data has varying SLAs so I can't fix the date updater to a static relative time range or I'm at risk of showing the user either stale data or no data at all. Thanks!

KeshiaRose commented 4 years ago

Hi @davidihernandez,

I would use the Data-Driven Parameters extension for that. Create a calculation that returns the correct date, for example, `MAX([Order Date]). If you don't already have that calculation or it isn't already on a worksheet somewhere on your dashboard then create a new worksheet with that calculation on it and bring it into your dashboard. You can hide it by making it floating and resize it to be 1x1 pixels. Then in the settings for the extension, choose your parameter to update, the worksheet with the calculation you made and then the calculation itself. Finally, go to the options tab and select "Automatically reset values on dashboard load." to override the parameter every time you open the dashboard.

This should get you the desired outcome you're looking for. Also, I want to note that this feature is currently slated to be built into the product starting with 2020.1. You can test it out with the Beta version.

Take care, Keshia

davidihernandez commented 4 years ago

Thanks @KeshiaRose ! This is getting me 90% there.

Quick question, is there a way to make it override the dash load if a user selects another date and then navigates to another dashboard in the same workbook? Essentially having the parameter update on initial dashboard load

  1. Extension updates my calendar picker widget to be the last available date (i.e. 1/1/2020)
  2. User selects another date to investigate (i.e. 12/25/2019), goes to the next dashboard tab to drill down
  3. Ideally the parameter stays at 12/25/2019, but the way it is currently configured, it will bring us back to 1/1/2020
KeshiaRose commented 4 years ago

Well poop, yeah that is the tricky part because the initialization function happens every time the dashboard is loaded whether it is the first time or a subsequent time and there is no way to tell the difference.

Depending on how much effort you want to put into this you could create your own extension that does the update. But you would have to have some way to determine if it was the first load or not. One way of doing it is to have a separate Tableau parameter boolean like Is first load? that you would save as true and then your extension could switch the value of the parameter to false when it loads. Then subsequent calls would check the Is first load? parameter and not run the update if set to false.

This would solve your problem but would also mean creating your own extension. Up to you if it is worth it for the dashboard switching issue.

Take care, Keshia

davidihernandez commented 4 years ago

@KeshiaRose thanks a lot for your quick responses! This is super helpful and I wouldn't have thought to use the extension as a hidden updater - I was just using it outright as the parameter.

I think I might try my hand at developing extensions when I get some down time. I think the compromise for me here will be to have only the first dashboard initialize the date and then other dashboards won't have the extension active. Hopefully there won't be too many complaints from users if they navigate back to the first dash and it resets :)