Countless use cases call for the use of toggles. In this blog, we’ll summarize the most common use of toggles with implementation examples. Let’s begin:
Implementing the Toggle
The easiest way to implement a toggle is to take two “On” and “Off” images and lay one atop the other using two Text objects.
In order to switch between “On” and “Off” images, we’ll need to use variables. Let’s create three variables: vOnOff1, vOnOff2, and vOnOff3. Set the default value to 0.
For the (Off) text object, go to Properties, create New Action and set vOnOff1 variable to 1. Also, switch to Layout tab and set Show Conditional to “=if(vOnOff1=0,1,0)”
For the (On) text object, go to Properties, create New Action and set vOnOff1 variable to 0. Also, switch to the Layout tab and set Show Conditional to “=if(vOnOff1=0,0,1)”
That it! Clicking the “Off” image hides the object and displays the “On” image instead. Clicking the “On” image does the reverse.
Now let’s look at the most common use cases for toggles:
For applications that use several tabs it may be advisable to hide infrequently used tabs to create a cleaner UI. This can be achieved with something like Settings tab that includes multiple toggles, one for each tab. Then we can limit the default view to a handful of tabs and enable the extra tabs as needed.
Hide one tab while enabling another tab on the same toggle
This is identical to the first use case, with the exception that one tab would be visible on Show, while another becomes visible on Hide.
Create Control Charts that can be enabled or hidden, implemented in the same manner as conditional show/hide tabs.
Swap calculation type within charts
For example, to toggle between Percentage and Numbers we would use conditional enable for Expression.
Add/remove columns in table charts
Similar to changing a calculation in a chart, we can add/remove columns in table charts. This approach makes the most sense for adding—let’s say—one extra column. To provide an ad-hoc selection of all columns in a table we would use load Dimensions and Measures into the data model, as described in this example: https://community.qlik.com/docs/DOC-5404
Tagging data points in Qlik
Toggles can even provide the ability to tag specific data points in Qlik for a write-back to the source (but that’s a topic for another blog).
This approach is applicable to both QlikView and Sense. Though Sense offers greater flexibility to use pre-built extensions to implement the actual toggle. Happy toggling!
Business Intelligence Architect
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
|cookielawinfo-checbox-analytics||11 months||This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".|
|cookielawinfo-checbox-functional||11 months||The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".|
|cookielawinfo-checbox-others||11 months||This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.|
|cookielawinfo-checkbox-necessary||11 months||This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".|
|cookielawinfo-checkbox-performance||11 months||This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".|
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.