Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Application that cycles through variable values automatically

Hey Folks,

I have a dashboard application that is intended to go up on a screen as a status update, and I need it to cycle through a series of values.

The short explanation is that it's using set analysis with a variable that is cycling through a number of variables to modify the contents of the charts in the application.

I have it set up thusly: (actually, I've tried two ways)

1) an action that changes the variable value according to the method I want.

2) a vb macro that does the same

I've tried converting the VB macro into something that runs in an infinite loop: apart from not quite working correctly in the desktop, the catch is that macros like this don't run on the server when viewing the document via AJAX.

I've also tried setting the action on after open of the document, and causing my browser window to refresh, but the document doesn't seem to consider the refresh action (or even a full browser close and re-open) to be a document 'open' and so, the value doesn't cycle.

Does anyone have any solutions that I haven't thought of?

UPDATE:

I have now also tried an onAfterReload action that does the cycling, and setting the reload to happen very frequently. I also then set the automatic update on reload parameters in the management console... Still no love.

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

You can create a timer type variable out of the Now()-function. Now() updates every second and by picking out the second or the minute you can scale and offset this base tick into the range and count frequency that you need.

Furthermore you can use dollar-sign expansion to use that as an index and append that to a variable so effectively you could have one variable being cycled through a number of indexed variables like:

CurrentValue = $(='A' & Mod(Round(Frac(Now()*24*60)*60),2)+3))

Which will cycle through two variables A3 and A4 every second.

It is not theory - I just tested it in a sample application.

This could also be transferred into referencing field-values or used as a timer updated indexing mechanism.

I have successfully used it to cycle through different Sheets and only have one sheet visible for a few seconds thus creating a slideshow.

View solution in original post

2 Replies
petter
Partner - Champion III
Partner - Champion III

You can create a timer type variable out of the Now()-function. Now() updates every second and by picking out the second or the minute you can scale and offset this base tick into the range and count frequency that you need.

Furthermore you can use dollar-sign expansion to use that as an index and append that to a variable so effectively you could have one variable being cycled through a number of indexed variables like:

CurrentValue = $(='A' & Mod(Round(Frac(Now()*24*60)*60),2)+3))

Which will cycle through two variables A3 and A4 every second.

It is not theory - I just tested it in a sample application.

This could also be transferred into referencing field-values or used as a timer updated indexing mechanism.

I have successfully used it to cycle through different Sheets and only have one sheet visible for a few seconds thus creating a slideshow.

Not applicable
Author

It doesn't refresh in AJAX, but I think there is an extension that I can use to get it to refresh.