QlikView Buttons – When, Why and How

You might think that there is not much to say about buttons in QlikView. If so you are probably not thinking much beyond a shiny lozenge of a thing that invites you to Clear Current Selections. I’m here to convince you otherwise.

Don’t Waste Space

The first thing to say here is that a Clear Current Selections button is totally redundant. That button is built right into the QlikView UI in Desktop and both Access Point versions. The same is true of Back, Bookmarks and (unless you have hidden your tabs) Next and Previous Tab buttons. Save yourself some space for some more analysis and don’t waste space with these buttons.

Default Button Style

In my opinion shiny lozenges take far more space up than they need to and are visually distracting. You should not use these unless you really have to (i.e. your client or user insists).

Many objects can be Buttons

Anything that supports Actions can be a button. The lowly Text Area serves this purpose admirably, and if you have to use a gauge in your app, at least make it useful by making it clickable. A text box with no borders or shading provides a clickable line of text – like the ones that have served web pages so well for many years now.

With the use of dynamic colours you can have traffic light dashboard components that can also be useful for triggering actions (such as a dive to detail). Simple shading behind your text can make a useful toggle switch in your app.

Using Actions For Hiding Sheets

Here are some examples of text boxes performing the actions of buttons. These examples place values into variables, which are then used to do something dynamic in the app.

In most of the QlikView apps I produce I have some tabs for system data that is hidden from most users. To implement this I set a variable in the load script:

let vShowDev = 0;

On the front sheet there is then a text box that has dynamic text:

=if (vShowDev = 0, 'Show', 'Hide') & ' Development Tabs'

And finally there is an Action to set the value of the variable:

=if(vShowDev = 0, 1, 0)

The toggle on the screen looks inconspicuously like this:

Show Development Tabs

All that is left then is to put the Conditional Show criteria on the correct sheets. The code for this is simply:

vShowDev = 1

Show Different Views Based On Variable Values

Another example of a show/hide toggle is where you want to swap between different charts or tables. Natively QlikView has the Auto-Minimise tick box and more recently the Container, but I am not a fan of using these. With a Conditional Show one object can be hidden and be replaced with a number of other objects.

To do a multi-way toggle I will set color variables up in the load script:

let vColHighlight = rgb(210, 255, 210);
let vColNoHighlight = rgb(255, 255, 255);

And default a display variable:

let vViewMode = 'Dashboard';

Text Areas are then required for each of the values you wish to set. Each text box simply has the legend of the view mode, and an Action to set the variable to the correct value:

Set View Mode To Analysis

The final step is to highlight which button is presently active. This is done by setting the Background Colour on each Text Object  to a dynamic colour with the following code:

if(vViewMode = 'Analysis', $(vColHighlight), $(vColNoHighlight))

With a bit of sizing and alignment the row of toggle buttons should look a bit like this:

Dashboard Analysis Detail

Again, a simple Show Conditional expression is required on each chart to dictate under which heading it displays.   The code for this will be:

vViewMode = 'Analysis'

Other QlikView Button Examples

There are many, many more examples of where using Actions on Text Objects or Gauges can be useful. Selecting a field to analyse, changing some UI feature, linking it to an external site or anything else you can think of.

I have created an app with a few examples that you may want to use in your own applications. You can download this from the Shared QlikViews section of QlikCommunity, here: http://community.qlikview.com/docs/DOC-4289

And you can see the app in this YouTube video here:

By |2017-01-19T17:03:10+00:00May 10th, 2013|QlikView Tutorial, Video|38 Comments

About the Author:

Steve is owner and principal consultant at Quick Intelligence. He is a Qlik Luminary, Qlik Community MVP and Technical Editor of a number of QlikView Books.

38 Comments

  1. Angad May 13, 2013 at 12:36 pm - Reply

    Great Work Steve, and rightly said let us try to make it as an application than just a report. :)

    • Steve Dark May 14, 2013 at 9:48 am - Reply

      Thanks Angad – it’s simply a case of being aware of the possibilities and being willing to think outside of the box.

  2. Gary May 17, 2013 at 7:31 pm - Reply

    Hi Steve,

    I enjoy your blog; good advice that on using other objects that have actions. Certainly how information is presented has changed significantly; not that long ago the issue was simply having the capability to GET the information! Overall discovery / B.I. is making progress in that now the focus is more on how information is delivered – both visual aspects as well as devices – laptops, smartphones and tablets.

    Thanks again for sharing your insights; it is always interesting to see how people and organizations are using the platform.

    Best Regards,
    Gary Beach

    • Steve Dark May 18, 2013 at 9:11 am - Reply

      Hi Gary, indeed, if you have read some of my other posts you will know I subscribe to the idea that “everything matters” – and an attractive functional design is obviously a big part of that. Assigning actions to objects is one way of helping to achieve that goal.

  3. Kevin Pinto May 19, 2013 at 10:54 pm - Reply

    Nice tips, thanks!

  4. radhika February 12, 2014 at 8:23 pm - Reply

    Hi,
    I am just wondering that there ia any button called show button in qlikview

    • Steve Dark February 12, 2014 at 10:25 pm - Reply

      By configuring the text and the actions on a text box you can have any button you want.

  5. […] QlikView buttons — When, How, Why via Quickintelligence […]

  6. Mark March 4, 2014 at 9:56 pm - Reply

    Steve, the text buttons are a nice touch, how did you achieve the white background with the green border?

    • Steve Dark March 4, 2014 at 10:09 pm - Reply

      They are simple text boxes. The white is a calculated colour on the Background Colour on the General tab. The code required for the calculated colour is given in the blog post. The border of the text box gets its colour from the caption colour on the text box (even though it doesn’t have a caption). You need to ensure the Border Width is set to 1 on the Layout tab.

  7. […] To learn more about QlikView buttons visit    Steve Dark blog […]

  8. qlikcentral June 25, 2014 at 9:23 am - Reply

    “The first bite is with the eye” – As they say.

    Lovely post Steve, I like the button design and also the fact they’ll look just as good if viewed through Ajax / Simplified design mode.

    Richard

    • Steve Dark June 25, 2014 at 9:28 am - Reply

      Thanks Richard! Simple is always best. There have been a number of good posts on flat design recently – definitely the way to go.

  9. Jamel Messaoud November 12, 2014 at 1:14 pm - Reply

    Hi Steve,

    I don’t suppose you have ever created a button to launch a Stored Procedure have you?

    • Steve Dark November 15, 2014 at 7:20 pm - Reply

      Hi Jamel, You would need to create an extension to do this. If you have a web page in an extension you should be able to fire a piece of ASP code (or similar) to execute the procedure for you.

  10. KK November 17, 2014 at 6:18 am - Reply

    HI Steve,
    Can we a upload button like thing in Qlikview which when clicked should open a “open dialog ” for
    selecting a file which contains data and the sheet should be loaded with the new data.

    Actually we have a requirement where user want to upload data from access point(or from QV desktop)
    which should be loaded(reload) and should perform the analytics.

    Regards KK

    • Steve Dark November 17, 2014 at 5:38 pm - Reply

      Hi Kiran, you may be able to do something like this with an extension, but I would recommend keeping the upload / reload separate from the analytics side. The easiest way to have people send data is by copying to a UNC path. You could create a web page to do the upload if the former is not possible – using ASP.net or similar. Triggering the reload can be done via EDX, you could wrap the whole lot up into a single piece of .net code if you needed.

  11. KK November 18, 2014 at 7:55 am - Reply

    Thanks a lot

  12. Harry February 11, 2015 at 2:32 pm - Reply

    Steve, is there a good way to clear up selection while moving between objects inside container ?
    I know currently- you can only set up a trigger while activate or leaving tab. But since I am inside a tab and switch between multiple object inside the container, how do I do that ?

    • Steve Dark February 11, 2015 at 3:16 pm - Reply

      Hi Harry. I very rarely use containers and even less frequently triggers on tab changes. Neither I feel give the control over the UI that is needed to build really good apps. If you implement toggling of objects using buttons and show/hide (as described above) then you can apply actions to your buttons to change selections – if required.

  13. Diego June 19, 2015 at 2:13 pm - Reply

    I wonder if it is possible not only change the color of the button when it selects , but also their appearance, font color or size, especially the style button. thank you very much (I’m not good with the English language )

    • Steve Dark June 20, 2015 at 10:31 am - Reply

      Hi Diego. Colour, font colour and text style can all be changed on an object (see the example file for this). Size and some other properties can not. For this you can show and hide two different text boxes. I have used this technique to show a light switch style rocker switch in QlikView, you can also get slider switches the same way. Good luck!

  14. Luci November 3, 2015 at 6:45 pm - Reply

    Steve, is there a way to automate the launching of a button’s actions? I am thinking that is a user makes a selection to some variable, I want to open the URL button automatically withiout having to click it.

    Thanks!

    • Steve Dark November 3, 2015 at 9:36 pm - Reply

      Hi Luci. You can start actions from buttons, and also from triggers. You can find the Triggers tab on both the Document Settings and Sheet Settings properties dialogs. On the document settings properties you will find actions that can be fired by variables or selections changing. You will have to test whether it works correctly in the situation you require.

  15. Dynamic colors in QlikView | wordpress December 14, 2015 at 2:09 pm - Reply

    […] To learn more about QlikView buttons visit    Steve Dark blog […]

  16. Mark March 21, 2016 at 3:49 pm - Reply

    Hi Steve,

    Great Post. Out of curiosity, how can one use a combination of buttons from multiple fields to get a unique chart or value using buttons and not a list box?

    For example, I have two ice cream shops where they both serve vanilla, Chocolate and Cherry Garcia. The charts is then created based on someone selecting Ice Cream shop A and then Vanilla.

    thank you in advance

    • Steve Dark March 22, 2016 at 8:34 am - Reply

      Hi Mark, you can place variables in a chart both as expressions or dimensions. Your button then just needs to set the correct value in the variable. Reference the variable as $(VariableName) in both cases.

      Hope that helps.

  17. alipeqal April 26, 2016 at 1:43 am - Reply

    hello steve, how to create button that exactly follow their shape of button

    • Steve Dark April 26, 2016 at 6:31 am - Reply

      Hi – you can get absolutely any shape of button, by using an image with a transparent background. The clickable area of a button like this will always be rectangular though – so try and pick images that fill the frame reasonably well. If you have objects or buttons where things overlap the transparent areas of your buttons you will need to ensure that you set the layer properties correctly to get the correct functionality.

      Hope that helps…

  18. sami Safraou April 27, 2016 at 3:02 pm - Reply

    Hello Steve, I was wondering if it’s possible to change a chart’s properties with a button, for example changing the style of a chart and go from stacked to grouped for a histogram
    thank you in advance

    • Steve Dark April 27, 2016 at 9:02 pm - Reply

      Hi Sami,

      There is a lot you can do by firing off macros from a button – but as these do not work 100% of the time (particularly in Ajax) I try to avoid them. Sadly you can not control the stack/group option with a variable, so that is not an option. The best bet in the case of group vs. stacked is to show and hide two different chart objects – there is an example of that in the demo app. Often you can simply change a variable to make things happen – for instance change the expression on a chart using a variable.

      Hope that helps.

  19. Fernando Jara July 15, 2016 at 7:07 pm - Reply

    Thanks, it’s very usefull for me.

  20. Julius August 23, 2017 at 4:42 am - Reply

    i have question.

    let’s say i have 5 chart in container(A, B, C, D, E), my requirement is: i have a button which the user click that button it will be directed to showing the chart E in that container. could you please help me how to do that?

    Thanks.

    • Steve Dark August 23, 2017 at 8:20 am - Reply

      Hi Julius, I’m not aware of how to change the tab of a container from a macro – not that I’ve tried either. This solution, with variables and show conditions, is an elegant alternative to containers.

  21. Liane Elon August 24, 2017 at 8:35 am - Reply

    Hi Steve,
    I’m new on QV and wondering if you could help me.
    I’m trying to make a button that filters a list box.
    I have a table which consists of continent and countries. I wish that whenever you select the Europe button it filters only the countries that are in Europe.
    have any idea how can I do that?

    thanks in advance for the help!

    • Steve Dark August 24, 2017 at 10:13 am - Reply

      Hi Liane, The great news is that you don’t need to have a button, you simply need to add two list boxes to the sheet, one with continents and the other with countries. QlikView’s associative engine will then sort the rest. IF you require a button for Europe as well as the list box, you want to attach a ‘Select In Field’ action, set the Field to Continent and the Search String to Europe. Hope that helps!

  22. Paul Nockolds September 26, 2017 at 3:34 pm - Reply

    This is great – thanks Steve. This is helping me tidy up a few messy looking sheets with too many objects at once into something much nicer for the user to look at and work with.

    • Steve Dark September 26, 2017 at 4:07 pm - Reply

      Thanks for your comment Paul. Glad it works well for you.

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.