Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Partner
Partner

Save and remember the selection

Hi Friends,

Is the below scenarios possible?

The user accesses the app from access point or from URL. Whenever he/she selects one value from a List Box/Multi Box, and logs off and logs in the next time, he should see the same selection as lastly selected by him. Is it possible anyhow by setting triggers or macros or bookmarks? Please elaborate.

One more challenge I see here, some other user must be accessing that app at the same time and he has selected something else in the list box and logs off. In the next log in he should see his respective last selection, not the User 1 selection.

I need this to implement. Suggestions would be helpful.

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Save and remember the selection

What I was referring to is the "Session Recovery" available in QV11. I orginally understood it to remember selections only as long as a session was not timed out. but it seems to remember selections across session timeouts and even server restarts. It works just like your original question. When a user opens a document from the server, the last selection state for that user is applied -- it's just like they never left. If you are running V11 on your server, that is the behavior you should be seeing now.

This is not available in the desktop, it's a server only function.

-Rob

View solution in original post

21 Replies
khadeer_sparks
Valued Contributor

Re: Save and remember the selection

Hi,

U can add to bookmark and triggers.

U have to give any default selection for this. So any one logged in he can see the default one instead of previous selection.

Hope it helps u

else try this macro

sub v

ActiveDocument.ClearDocBookmarks

activedocument.fields("e").clear
activedocument.fields("f").clear
activedocument.fields("g").clear

ActiveDocument.CreateDocBookmark false, "MyBookmark"

ActiveDocument.Back
ActiveDocument.Back
ActiveDocument.Back


end sub

What this will do is when u click the button it will clear the fields which u dont want to include in Bookmark and

then it will create the Bookmark and again go back to the original state

and ur code  ActiveDocument.GetSheetObject("LB02").GetSelectedValues is wrong because u have to

take the column taken in that list box so ur code should be activedocument.fields("b").getselectedvalues

where b is the column u have taken in the list box

Partner
Partner

Re: Save and remember the selection

Thanks for the reply.

I underestand your statement. That I can implement. But if the user changes his selection, he should not see the default selection again. He should see the new selection next time wherever he had logged off.

I need some more elaboration on this.

Highlighted
khadeer_sparks
Valued Contributor

Re: Save and remember the selection

It can be resolved by using triggers, So user can see only perticuler year n month values(By default), he can select other selections also, once he logged off and logged in again , he can see only default selections, which r given in triggers.

Partner
Partner

Re: Save and remember the selection

Hi, Can u please attach a sample QVW file showing the example. Hope you have understood the requirements correctly. Thanks.

Partner
Partner

Re: Save and remember the selection

Hi friends,

Any solutions to the above query??? Please suggest.

khadeer_sparks
Valued Contributor

Re: Save and remember the selection

Hi,

PFA.

Document Properties...... Triggers Tab......On Open.....Ur conditions

Hope it helps u.

Partner
Partner

Re: Save and remember the selection

Hi QVLearner,

Appreciate your efforts.  In your case, you have set the Trigger on 2012. So if I close the doc and in my next login I will see 2012 as selected.

But my scenario is bit different. Suppose in your example, I select 2010 and close the doc (may/may not before saving), in my next log in I should see 2010. Again if I select 2006 and close the doc, I would expect 2006 in my next login. This is what I want.

Here I see one more challenge too. Some other user must be accessing that app at the same time (from Access Point) and he has selected something else in the list box  and logs off. In the next log in he should see his respective last selection, not the User 1 selection.

Can anyone please suggest how to deal with this?

mov
Esteemed Contributor III

Re: Save and remember the selection

The bookmark approach should be fine.

You can create a bookmark, and use it "on open".  Use trigger "on any select" to override this bookmark on each selection.  When you save the document, it will store your last selection in the bookmark, and next time you open it you get this selection.

Regards,

Michael

Partner
Partner

Re: Save and remember the selection

Michael, Thanks for some help. But somehow this approach is not working that way. Can you post a QVW with a small example and some details please? Hope you have understood the scenario. Thanks.