Tyler Buhr Posted April 8, 2021 Posted April 8, 2021 I would like to display the date and time of when an embedded data source was last refreshed/updated into the data canvas in a textbox on my visualization, the date time at the bottom of the image. I do not want the current date time, i.e datetime now,as the data is not refreshed each time the viz is opened, the backend data is manually refreshed by me. Thanks for any and all help or suggestions!
Stephane Forrer Posted July 13, 2023 Posted July 13, 2023 Did you ever find a solution for this ... I'm looking for the same? Thanks!
Fredrik Rosell Posted July 13, 2023 Posted July 13, 2023 Hello,To my knowledge there is no direct access to that data canvas information but here are two approaches with various pros and cons - maybe one could work for you:1.One solution for this that I have seen used is to include the date as part of the data. Example:In an information link retrieving the data, add a column element, let's call it "Report Date". The expression for it is whatever can be used in that underlying database to get the current datetime, e.g. GETDATE(). Your returned data will contain a column that contains the report date. Now you can display that datetime using a calculated value in a Text Area. You'll need to get a single value to display, so e.g. use Max([Report Date])----------2.>the backend data is manually refreshed by meIn this case, maybe an easy solution could be to do the refresh as well as update a document property with the refresh time using an IronPython script.Example:import datetime;# Reload all data in all tablesDocument.Data.Tables.ReloadAllData()# Update the propertyDocument.Properties["propDataLastReloaded"] = str(datetime.datetime.now())--------That document property value is what you then display in your dashboard (e.g. in a text area, or in the title of a plot) to show the time of last data refresh.Example:
Stephane Forrer Posted August 18, 2023 Posted August 18, 2023 Thanks Frederik, I ended up setting a Document Property with a simple Python data function grabbing the file(s) modification date. e.g.: import os.path, time filepath = ... modified_dt = time.ctime(os.path.getmtime(filepath)) All the best Stéphane
Fredrik Rosell Posted August 18, 2023 Posted August 18, 2023 Excellent - thank you for sharing that with the community, Stephane!Best RegardsFredrik
Cristian Tibrea Posted August 21, 2023 Posted August 21, 2023 I use a text Area visual where I add calculated value and choose the MAX(current_Timestamp()) in the Values field
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now