“Data Last Updated On Date” Widget
You can easily add a widget at the top of your dashboard that will state the date and time on which data was last updated. The below solution can be applied in Sisense version 6.7.1 and later.
Solution:
1. Add an Indicator widget to your dashboard. Open Advanced Configuration and copy-paste the below formula in the Value field:
MAX([Days in SomeDate])
Save this widget. The widget now displays an empty value:
This is the expected behaviour.
2. Add the following script to the widget:
widget.on("processresult", function(scope, args) {
var maxDate = args.rawResult.values[0].text;
args.result.value.text = maxDate;
})
Refresh your screen. The widget now displays the last day on which data was modified, in the mm/dd/yyyy hh:mm:ss format:
3. To display this date in the mm/dd/yyyy format instead, use this code:
widget.on("processresult", function(scope, args) {
var maxDate = args.rawResult.values[0].text;
var length = maxDate.indexOf(" ");
maxDate = maxDate.substring(0, length)
args.result.value.text = maxDate;
})
Refresh your screen. The widget now displays the value in this format:
4. In the Value field, give a name to the widget that would be clear to the dashboard users, for example:
-
Is there any way to get the TIME component to display as well? This is very useful in cases where there is multiple cube builds per day
Unfortunately it doesn't seem Sisense supports DateTime (Date AND Time in a single field) you always have to split them, which results in incorrect results a lot of time.
-
Hi Hendrik,
first of all the refresh of data in ECube is always displayed in top bar above dashboard so maybe that would be sufficient. As o workaround for this issue i suggest creating a custom query in ECube which will extract a max date as a single string(store it as text), and then use SmartLable plugin to display it at the top of the dashboard. Hope it helps.
Regards,
Michał
-
Hi Michael
Thanks for the quick reply. We use Sisense Embedded and hide all toolbars from the end-user - so they don't see the top bar with last refresh date.
We've had mountains of issues with widget incompatibilities so been trying to steer clear of any custom widgets we don't have to use. I've already added a custom table in the cube with latest date, its now just a matter of getting it displayed in Date AND Time form (using the correct time format of DD/MM/YYYY) - I'll try the smart label in our dev environment, otherwise I'll stick with a plain table. Pity as I'd like to make the dashboards look a bit better.
Please sign in to leave a comment.
Comments
7 comments