Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
Jennell_Yorkman
Employee
Employee

I recently had an interesting use case for bookmarks that I thought I would share. I have a Qlik Sense app that will be accessed from more than one external source and the view of the app will differ depending on the referral link. In one scenario, the user is directed to the app overview of the app.  In this scenario, no charts are highlighted. In the second scenario, the user is directed to a specific sheet in the app and a specific chart is highlighted.  A message should also be displayed above the chart in this scenario. In this blog post, I will share an example of how this can be accomplished.

Here is a look at the original sheet:

orig.png

And below is an example of the sheet with the top left chart highlighted. Notice that the chart is outlined and there is text above the chart. This is how the sheet should look in the second scenario when the user accesses the app via the bookmark URL.

original.png

To create the highlight for the chart, I added a layout container to the sheet. In the layout container, I added a text box for the highlight, a text box for the message and the chart I want to highlight. I made the background color of the first text object the color I wanted the highlight to be and positioned it behind the chart and a little larger than the chart (so that it appears like a border). I did not simply add a border to the chart because I want to control the show and hide of the highlight via a field value. The second text box has the message text and the same background color as the sheet.

I decided to use a field, _Message1, to control the show and hide of the highlight and the message.  I added a table like the one below for this field.

table.png

 

 

 

 

I also use HidePrefix in the script before loading the table so that selections in this field do not appear in the selection bar.

hideprefix.png

 

I used the _Message1 field in the Show condition for the two text boxes (highlight and message) so that they were only visible when _Message1 = 1.

show condition.png

 

 

I also used the _Message1 field to change the bubble for the sales rep that I mentioned in the message. This can be done by using an expression to color the scatterplot bubbles.

color.png

 

 

Now, the only thing left to do is to create a bookmark that can be used to direct users to the Sales Analysis sheet and highlight the scatterplot. Before creating the bookmark, I went to the Sales Analysis sheet and selected 1 in the _Message1 field. Since I am hiding the _Message1 field, I made the selection in the browser URL by adding /select/_Message1/1 to the end URL while in analysis mode.

select.png

 

 

Now create a new bookmark and be sure to check ‘Save sheet location’ and ‘Save layout.’ To test the bookmark, clear selections in the selection bar and then select the bookmark.  Don’t forget to make the bookmark public before publishing the app. Once the app is published, you can copy the link to the bookmark by going to bookmarks and clicking on the three dots next to the bookmark name and selecting Copy link. This bookmark link is what I used in an external source to direct users to the Sales Analysis sheet with the scatterplot highlighted. When I want to direct users to the app overview, I provided the URL to the app. The bookmark can also be used within the app, if necessary. If you do not want users to be able to clear the _Message1 field/remove the highlight and message, lock the field before creating the bookmark. This will prevent the _Message1 field from being cleared when the user clears all selections. To do this, you may need to temporarily remove the hideprefix in the script to lock the field.

If you would like to highlight a chart from within an app (and not an external source), consider using a button and the Go to chart action as seen in the May 2024 – Button Go to Chart sheet in the What’s New app.  This allows you to add an action on a button that will not only direct you to a specific sheet but also to a chart that is temporarily highlighted.

This example illustrates how an app can have various views based on the referral URL. When accessing the URL to the app, the app is displayed without any chart highlights. Be sure to set the _Message1 field to 0 prior to publishing the app to ensure this.  By using a bookmark URL, a message and highlighted chart is visible in the same app providing a different view for the user. This is just one of the many ways this can be accomplished in Qlik Sense.

Thanks,

Jennell