Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
jameswills
Contributor III
Contributor III

Q? Text box only visible for a set period of time?


Am new to QV and was wondering if it was possible to make a text object disappear after x number of seconds. I'm looking to pop an info box up when someone opens a tab but want it to be removed after a set period of time.

Is this possible?

1 Solution

Accepted Solutions
morganaaron
Specialist
Specialist

That's probably because the Second() command Alessandro has used picks up the second part of the time only, so will reset every minute and show again as long as the seconds elapsed for that minute are less than the seconds on timestamp + however many you dictated.

If you only want it to appear once, use:

Now() - vNow < 0.0001    (or replace 0.0001 with X/86400, where X is your number of seconds, so (5/86400) for 5 seconds..)

That will give you roughly 8.5 seconds - it translates the timestamp into a real value where 1 equals a full day, and so if you break a day into seconds (86400 of them!) you can translate your seconds requirement into X/86400.

Hope that makes sense!

View solution in original post

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

If you use text box in presentation tab there is a "conditional show" box.

you can place there the condition to show the text box for some seconds

morganaaron
Specialist
Specialist

You can create a variable and then in the sheet properties there will be a triggers tab, set a trigger in here OnActivateSheet to set that variable to equal now() - that will timestamp when a user accesses the tab.

Then as Alessandro suggested, use this variable and add on whatever amount of time you want to, and you could use a condition that says where now() is less than your variable plus the time you want it to show for.

jameswills
Contributor III
Contributor III
Author

Thanks Alessandro, what would the condition syntax be please?

jameswills
Contributor III
Contributor III
Author

Thanks Alan, what would the conditional show look like pease if the variable set on activate was "vtextbox_visible"?

alexandros17
Partner - Champion III
Partner - Champion III

Second(Now())-Second(vTime) < 3

in the conditional view,

define

Let vTime = '';

in the script an finally, in the tab add a trigger -> external -> set variable write in the upper textbox vTime, in the bottom write

=Now()

let me know

jameswills
Contributor III
Contributor III
Author

Thanks Alessandro

The changes you suggested do work 🙂 but the text box re-appears ater 30 secs, then disappears again. This happens on a loop.

I think I'll change approach and put a button for them to click which clears (and accepts acknowledgement) the text box.

Thanks for looking at this though.

morganaaron
Specialist
Specialist

That's probably because the Second() command Alessandro has used picks up the second part of the time only, so will reset every minute and show again as long as the seconds elapsed for that minute are less than the seconds on timestamp + however many you dictated.

If you only want it to appear once, use:

Now() - vNow < 0.0001    (or replace 0.0001 with X/86400, where X is your number of seconds, so (5/86400) for 5 seconds..)

That will give you roughly 8.5 seconds - it translates the timestamp into a real value where 1 equals a full day, and so if you break a day into seconds (86400 of them!) you can translate your seconds requirement into X/86400.

Hope that makes sense!

morganaaron
Specialist
Specialist

Also worth mentioning however, the now() command being used in the frontend like that can be resource intensive, as it's constantly calling the function every second - so your other suggestion of a button to click and clear the message is probably a much better and more resource efficient one!