# On/Off Switch for Qlik Sense

> Set a variable in Qlik Sense to true/false using an on-off switch.

[![](http://serve.mod.bz/branch/)](https://github.com/stefanwalther/sense-on-off-switch)

***

## Table of Contents

<!-- toc -->

* [Screenshot](#screenshot)
* [Installation](#installation)
* [Usage](#usage)
* [Tested with](#tested-with)
* [Related projects](#related-projects)
* [Contributing](#contributing)
* [Author](#author)
* [License](#license)

_(Table of contents generated by [verb])_

<!-- tocstop -->

***

## Screenshot

[![](docs/images/On-Off-Switch--Qlik-Sense_small.png)](#screenshot)

## Installation

1. Download the [latest version](https://github.com/stefanwalther/sense-on-off-switch/raw/master/build/swr-on-off-switch_latest.zip)
2. Qlik Sense Desktop
  - To install, copy all files in the .zip file to folder "C:\Users%USERNAME%\Documents\Qlik\Sense\Extensions\On-Off-Switch"
* Qlik Sense Server
  - See instructions [how to import an extension on Qlik Sense Server](http://help.qlik.com/sense/en-US/online/#../Subsystems/Qlik_Management_Console_help/Content/QMC_Resources_Extensions_AddingExtensions.htm?Highlight=extension)

## Usage

Drag and drop the visualization extension onto a sheet and define

* the name of the variable
* the layout

[![](docs/images/prop-panel.png)](#installation)

### Variable

The variable will not be created by the extension, you have to create the variable in your data load script, e.g.

```bash
SET vOnOffSwitch = 0; // false
or 
SET vOnOffSwitch = 1; // true
```

### Default values

The following variable lower-cased values will be interpreted as false:

* `false`
* `no`
* `0`

whereas

* `true`
* `no`
* `1`

### Values set

If the user switches the on-off switch to false the variable value will be set to `0`, otherwise to `1`.

## Tested with

**Qlik Sense**

* Qlik Sense Server 2.0.1
* Qlik Sense Desktop 2.0.1

**Browser**

* Chrome (latest version as of 2015-07-07)

If you experience any issues with other versions of Qlik Sense and/or browsers, [please create an issue](https://github.com/stefanwalther/sense-on-off-switch/issues) and let me know.

## Related projects

Some other Qlik Sense Visualization Extensions recently published:

* [qliksense-extension-tutorial](https://github.com/stefanwalther/qliksense-extension-tutorial): Comprehensive tutorial to start developing Qlik Sense Extensions.
* [sense-media-box](https://github.com/stefanwalther/sense-media-box): Include web pages, videos, images and much more into your Qlik Sense app.
* [sense-themable-kpi-tile](https://github.com/stefanwalther/sense-themable-kpi-tile): KPI Tile for Qlik Sense with the ability to use themes or to customize background… [more](https://github.com/stefanwalther/sense-themable-kpi-tile)

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/stefanwalther/sense-on-off-switch/issues).
The process for contributing is outlined below:

1. Create a fork of the project
2. Work on whatever bug or feature you wish
3. Create a pull request (PR)

I cannot guarantee that I will merge all PRs but I will evaluate them all.

## Author

**Stefan Walther**

+ [qliksite.io](http://qliksite.io)
* [twitter/waltherstefan](http://twitter.com/waltherstefan)
* [github.com/stefanwalther](http://github.com/stefanwalther)

## License

Copyright © 2015 Stefan Walther

Released under the MIT license.

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 12, 2015._