Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Toggling Back and Forward

There will be occasions with my dashboard where a user will click some selection, see that all the charts and gauges have changed, and then want to alternately click forward and back to see all the changes to all the objects that occur with that selection change. Its difficult to keep your eyes fixed on a gauge or line on a chart when you have to glance up to make sure you click the Back button correctly. After you do, your eyes have to go back down to the chart and recall where things were a second ago. Its not a huge probem, but it would be much easier if there was a button they could click that would toggle between the last two states. Click it once, you go back a step. Click it again, you go forward a step. Click back. Click forward. The eyes can stay on the charts the whole time.

For the life of me, though, I can't figure out how to program such a button. I can create a button that goes back, obviously, or forward, but I cant seem to embed the back or forward behavior in an If statement tied to a variable I can toggle. If there is a "back" function, I haven't seen it. And if I create a text field or button with a Back action, it seems that any other actions I put there to follow get ignored. If I have an action to set a variable first, then both that action and the back action after it is ignored.

Anyone ever try to create a kind of A/B switch to toggle the last two states? It sounds like it should be simple enough, but maybe it can only be done in some more complicated way?

Thanks in advance

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I don't think the variable idea will work. Back/Forward reset variables as well. When you go Back, the variable will contain it's prior value, not the value just set. I don't think there is any way an Action in Time 0 can update a variable to be seen in Time -1.

One solution would be to toggle a variable that contains a {$1) Set Expression, {$1} refers to the previous selection. Downside is you would have to include the variable in all your expressions. The attached ClickTrails qvw shows the idea, but in this case showing both sets in the chart all the time.

There may be some clever technique using Alternate States to create a single button, but it escapes me at the moment. Seems like this should be resolvable, but I'm drawing blanks.

-Rob

View solution in original post

7 Replies
Mark_Little
Luminary
Luminary

Hi,

I think you're are half way there!

I would approach it with two buttons, as you mentioned before, one that toggles back and one that toggles forward. The trick then is to have a variable as vShow 0 for the back and 1 for forward. In the layout add the condition to show each and add action to chang the toggle. Over lay the two buttons and as far as the user can tell it is one button.

Mark

Not applicable
Author

Hi, Create 2 buttons and always show only one button. Create a variable that holds value to show one button & hide the other button vice versa.

Each button have 2 actions: 1. Back or Forward depends on your operation 2. Set Variable to change the value to 0 to -1 & vice versa

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I don't think the variable idea will work. Back/Forward reset variables as well. When you go Back, the variable will contain it's prior value, not the value just set. I don't think there is any way an Action in Time 0 can update a variable to be seen in Time -1.

One solution would be to toggle a variable that contains a {$1) Set Expression, {$1} refers to the previous selection. Downside is you would have to include the variable in all your expressions. The attached ClickTrails qvw shows the idea, but in this case showing both sets in the chart all the time.

There may be some clever technique using Alternate States to create a single button, but it escapes me at the moment. Seems like this should be resolvable, but I'm drawing blanks.

-Rob

Anonymous
Not applicable
Author

If the end game is to be able to visually compare objects in two different states, then that is exactly what Alternate States were designed for.  So why not have 2 sets of your objects each in their own Alternate State.

Not applicable
Author

Well, that's pretty much what I was thinking when I said maybe it can be done only in "some more complicated way".

I would have preferred not to have to preserve an alternate state every time the user hits the "back" button, but if that's the only way to do it, then it's the only way to do it. I'm a little surprised-- although frankly I haven't give it a great deal of thought and there might be a perfectly good reason-- that there's no "Back" and "Forward" function..If it can be clicked, why not coded?

Anonymous
Not applicable
Author

That was not what I was suggesting.

I was suggesting 2 independent set of identical objects, each in its own Alternate State.

So selections can be done on StateA objects will be independent of Selections done on StateB objects.

Then the StateA and StateB objects can be compared side by side with no need for any "Back" and "Forward" functions.

Not applicable
Author

I appreciate it, but that seems like overkill in this particular case. The vast majority of the time the alternate set of gauges and other objects will just be taking up a lot of space. I could open a new sheet for that, so there isn't two sets of everything on display all the time, but its really not a big enough deal to get into that much time and effort and structural modifications, etc.. I thought it might be relatively simple and I just didn't know how to do it. If that's not true-- and it looks like its not if it managed to stump Rob-- then I'll forego the idea unless something clever comes to me in a dream. I have a couple of ideas brewing. Thanks for everyone's input.