Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

hmjason7
New Contributor

Automatically cycle through a field on the front-end

Hi All,

Is there a way of cycling through all the values for a given field?

For example, say we have a EmployeeName field with Values "Jack, John,Jake". We want the dashboard to "automatically" cycle through each value in the given field every 15 seconds (or whatever length of time we want).

So it would be like having a person click on "Jack" from a listbox, then after 15 seconds clicking on John, then Jake, and then back to Jack.

I don't think this can be done natively, so macros first come to mind. But I wanted to ask if there was a way of doing it without the use of macros.

Cheers,

Jason

1 Solution

Accepted Solutions
luciancotea
Valued Contributor

Re: Automatically cycle through a field on the front-end

Yes, it is possible.

1. Add a variable that has =now() as expression

2. Add a trigger on OnChange event of the variable (Documant Properties -> Triggers -> Variables) that will select a value based on an expression

3. Add a textbox to display the variable value in order to force QlikView to refresh it

See attachment

4 Replies
luciancotea
Valued Contributor

Re: Automatically cycle through a field on the front-end

Yes, it is possible.

1. Add a variable that has =now() as expression

2. Add a trigger on OnChange event of the variable (Documant Properties -> Triggers -> Variables) that will select a value based on an expression

3. Add a textbox to display the variable value in order to force QlikView to refresh it

See attachment

hmjason7
New Contributor

Re: Automatically cycle through a field on the front-end

Hi Lucian,

That looks good. I noticed in the trigger you're doing the cycle in an if statement, specifically stating the values you want to loop over.

Is there a way of doing this without having to state the values you wish to cycle over?

Re: Automatically cycle through a field on the front-end

Do beware that on the Accesspoint using Now() like this only works properly with the IE Plugin and not in AJAX mode.

luciancotea
Valued Contributor

Re: Automatically cycle through a field on the front-end

Use getfieldselections() to get the current selected value. Based on this, build an expression that will determine the next value.

Or, you can use macro.: http://community.qlik.com/thread/10565

Community Browser