-
1. Re: Auto update date and time/ count of calculated fields
Tom WMar 2, 2017 2:53 PM (in response to Radi Saran)
What's your source?
If you're connecting to a database you could do something like this:
SELECT GETDATE() as TimeStamp, CF1, CF2, CF3 FROM mytable
Then setup your extract to refresh daily and append to the existing data.
-
2. Re: Auto update date and time/ count of calculated fields
Radi Saran Mar 2, 2017 3:01 PM (in response to Tom W)I am currently using a postgres SQL query. also the calculated fields are in created in Tableau.
Thanks
-
3. Re: Auto update date and time/ count of calculated fields
Tom WMar 2, 2017 3:11 PM (in response to Radi Saran)
Use a timestamp like GETDATE() or NOW() in your SQL query, whatever the equivalent is for postgres. You're going to need to use custom sql or add a column to your view utilizing that function in order to bring it into Tableau.
-
4. Re: Auto update date and time/ count of calculated fields
Radi Saran Mar 2, 2017 3:23 PM (in response to Tom W)But how do I store it.. like the above example
-
5. Re: Auto update date and time/ count of calculated fields
Tom WMar 2, 2017 5:29 PM (in response to Radi Saran)
In your database each day or as I suggested in my first post, look at
creating an incremental extract which would be appended to each refresh.
-
6. Re: Auto update date and time/ count of calculated fields
Radi Saran Mar 10, 2017 8:30 AM (in response to Tom W)So should I create the incremental refresh using the datetime column?
-
7. Re: Auto update date and time/ count of calculated fields
Tom WMar 10, 2017 8:38 AM (in response to Radi Saran)
As I said earlier:
Use a timestamp like GETDATE() or NOW() in your SQL query, whatever the equivalent is for postgres. You're going to need to use custom sql or add a column to your view utilizing that function in order to bring it into Tableau.
Once you've added a timestamp to your query, you just need to setup an incremental refresh based off the timestamp column. Take a look at this - Quick Start: Incremental Extract Updates
In terms of automating the refresh to run every day - do you have Tableau Server or Desktop only? If you have server it's easy, just take a look at the refresh schedule options.
Desktop only - take a look through this - Tableau Automated Extractions Update Tool or Tableau Automated Extractions Update Tool
Honestly, you might just be better to automate this as a job using a script to run every day outside of tableau and save the data into a new database table rather than relying on Tableau to do the scheduling / refresh component of this.
-
8. Re: Auto update date and time/ count of calculated fields
Radi Saran Mar 10, 2017 9:21 AM (in response to Tom W)Thanks Tom.. I am going to try the methods that you have mentioned.
Yes I am using Tableau desktop. I am not familiar with any scripting languages to try and automate. Unfortunately that is why I am dependent on tableau refresh to update the columns.
-
9. Re: Auto update date and time/ count of calculated fields
Tom WMar 10, 2017 9:27 AM (in response to Radi Saran)
Tableau Desktop won't automatically refresh this on it's own, that's for sure. There's a couple of tools people here use as I've already linked to, otherwise you need Tableau Server (or Tableau Online) or a script of some kind.
Good luck!