Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik developers,
I know more or less how ReloadTime works and how it displays it. But I want to show something like: Last Reload Time was 5 minutes ago, or 2h and 35 mins ago... instead of the usual Date format it displays.
Is this possible?
Thanks.
Hi,
You can try to use an expression like (interval(now() - ReloadTime()))
example:
Aurélien
Hi,
You can try to use an expression like (interval(now() - ReloadTime()))
example:
Aurélien
Hi thanks for the response!
It does work but can it also be applied for days? I mean, if its more than a day, the hour should be something like 24 or more. Is there a function to solve this or should I just use a If clause as to substract when it pass 24 and put a 1 or something like that?
I have this for hours and minutes:
= 'Actualizado hace ' &
If(Hour(Interval(Now() - ReloadTime())) > 0, Hour(Interval(Now() - ReloadTime())) & ' h y ' & Minute(Interval(Now() - ReloadTime())) &' min',
Minute(Interval(Now() - ReloadTime())) &' min')
And this is what it shows (I guess it will still work if there are hours):
Thanks!
There aren't any built-in functions to translate an interval into an language-specific text representation such as "Two days, five hours, seventeen minutes and three seconds". You can format an interval along the lines of 'D:hh:mm:ss' though.
I tied to add second parameter like 'd h m s' and I think that display day hour minute second
Interval((now()) - ReloadTime(), 'd h m s')
Sorry I have a last thing, I don´t know if it has a solution or not, but I use this expression with minute (= Minute(interval(now() - ReloadTime())) & ' minutes') on the object that reloads your app, so when I push the button, it reloads the app, but instead of showing me 0 minutes, it shows me 59 minutes. If I F5 the page at the instant it will show correctly the 0 minute, but only if i refresh.
Green means it just refreshed cuz I pushed the button.
I kinda know why could it happen but I don´t know how to solve this, Can I add like 1 or 2 seconds? Or is this not the solution.
Thanks.