January 12, 2011

A Novel Bookmark Display

This post arose after a client asked for a view of document bookmarks that was similar to a horizontally arranged list box selector. The QV model had a number of states which could be selected using these bookmarks. He wanted his staff to be able to see the selected. The solution looked something like this:

I achieved this as follows:


Step 1: Create the document bookmarks in the normal manner.

Step 2: Open the bookmarks dialog (Bookmarks | More) to get the bookmark Ids for each bookmark. Then uncheck the checkboxes in the “+” column.

Step 3: Create an inline table in the load script with the bookmark names and IDs – something like this:


LOAD * INLINE
[
BMName, BMId
Stock on hand, BM32
Reclaim pending, BM30
Legal hold, BM26
Write offs, BM33
Phyical stock, BM29
Saleable stock, BM31
];


Step 4: Create a list box containing BMName, and arrange horizontally. You can also sort the list box by load order, if appropriate.

Step 5: Add the BMName selection to each bookmark, by selecting the bookmark (from a bookmark control, or the menu. Then select the corresponding BMName value. Finally, click Bookmarks | Replace bookmark to update the bookmark with the BMName selection. I used an open Current Selections box to verify the correct behaviour.

Step 6: (Almost there!) Go to Settings | Document Properties | Triggers and add an On Select trigger on the field BMName. Add a Clear All action, followed by an Apply Bookmark action. For the Bookmark ID for the latter, enter “=BMId” (without the quotes!).

That’s it. Now selecting a value in the “selector bar” for the bookmarks will apply the bookmark and show the currently applied bookmark. Clicking the selected value will clear the bookmark (ie normal list box behaviour).

If you find this useful, or would have any comments on this technique, please post a comment.

10 comments:

  1. Thanks for the great idea Jonathan. Can't wait to give it a try in a project.

    ReplyDelete
  2. More than 2 years old post.. But still its very useful..

    Thanks

    ReplyDelete
  3. Hi Jo , yes this is very good appraoch. recently i use this appraoch ( in line load ) for my dimension selection. and i can use in every Sheet and when i change the in line load text , all page changes. very productive. ( compare to the old approach i write script on list box , which is not good), thank you for sharing use this for book mark.

    ReplyDelete
  4. http://community.qlikview.com/thread/100867

    Hi jonathan
    I try to do what you mentioned . but i am not able to get it right. above link is my post to forum, hope you can advise me. Thank.

    ReplyDelete
  5. Excellent idea, thanks for the post!

    ReplyDelete
  6. Great idea - simple and effective

    ReplyDelete
  7. can i use this appraoch for user bookmarks??

    ReplyDelete
  8. Any similar feature to get IDs/Apply bookmarks for User/Server Bookmarks?
    Can we don in Action of a Button or any Macro?

    ReplyDelete