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.
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:
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:
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:
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: https://community.qlik.com/t5/Member-Articles/QlikView-App-At-The-Qlik-Of-A-Button/ta-p/1484152
And you can see the app in this YouTube video here:
Great Work Steve, and rightly said let us try to make it as an application than just a report. :)
Thanks Angad – it’s simply a case of being aware of the possibilities and being willing to think outside of the box.
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
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.
Nice tips, thanks!
Hi,
I am just wondering that there ia any button called show button in qlikview
By configuring the text and the actions on a text box you can have any button you want.
[…] QlikView buttons — When, How, Why via Quickintelligence […]
Steve, the text buttons are a nice touch, how did you achieve the white background with the green border?
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.
[…] To learn more about QlikView buttons visit Steve Dark blog […]
“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
Thanks Richard! Simple is always best. There have been a number of good posts on flat design recently – definitely the way to go.
Hi Steve,
I don’t suppose you have ever created a button to launch a Stored Procedure have you?
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.
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
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.
Thanks a lot
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 ?
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.
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 )
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!
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!
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.
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
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.
hello steve, how to create button that exactly follow their shape of button
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…
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
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.
Thanks, it’s very usefull for me.
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.
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.
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!
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!
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.
Thanks for your comment Paul. Glad it works well for you.