# 10. Variables

Analysts are often faced with the challenging task of navigating large datasets that span multiple dimension categories and time frames - this is where Inforiver variables can save the day. Variables offer a range of options to efficiently traverse your datasets, apply filters, and even run ad-hoc scripts. Variables are graphical controls like buttons, checkboxes, or steppers that can accept user input to perform actions like setting a filter or changing the layout.&#x20;

See how variables can make report navigation and editing easier without creating Inforiver filters or manually editing the header or visual measures.

<figure><img src="https://content.gitbook.com/content/sB9HAei8v4FfKkH9M4gw/blobs/lvXYOQuAoFmIFP7PeJOk/2.2.%20variables-gif.gif" alt=""><figcaption><p>Variable controls in Inforiver</p></figcaption></figure>

Let's take a deep dive into Inforiver variables.

## 1. Creating variables

**STEP 1:** You can create variable controls in your reports by clicking the **Variables** button in the **Insert** ribbon.

<figure><img src="https://2428652681-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsB9HAei8v4FfKkH9M4gw%2Fuploads%2FXKU7FSRjBibZHftauBv4%2Fimage.png?alt=media&#x26;token=6c0d4e64-6ebb-4e93-ba85-c757bd4d10ce" alt=""><figcaption><p>Creating variables</p></figcaption></figure>

**STEP 2:** Click the **Add Variable** button in the **Define Variables** window. You'll need to specify the&#x20;

* **Label**: Set a name to identify the variable.
* **Type**: Choose the type of variable: numeric, options, text, button, boolean, date range, etc.
* **Value**: Set a default value for the variable.

<figure><img src="https://2428652681-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsB9HAei8v4FfKkH9M4gw%2Fuploads%2Fo9wo8gXFhpXokHPiwHOP%2Fimage.png?alt=media&#x26;token=c3803a51-4aac-4652-98a1-1030c85e5834" alt=""><figcaption><p>Adding variables</p></figcaption></figure>

**STEP 3:** Click the edit<img src="https://content.gitbook.com/content/sB9HAei8v4FfKkH9M4gw/blobs/e3ZNZf8oFMYA8P4KiWIL/image.png" alt="" data-size="line"> icon to customize the variable. We'll cover the various options in detail in subsequent sections.

<figure><img src="https://2428652681-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsB9HAei8v4FfKkH9M4gw%2Fuploads%2FwnWeaTAKd9zbRqKnldzs%2Fimage.png?alt=media&#x26;token=17730ed7-c5da-4ecd-bafe-645bd29b9ba2" alt=""><figcaption><p>Variable properties</p></figcaption></figure>

**STEP 4:** You can display variables in a side panel. Check the **Include in Variables Panel** option if you want to expose the variable in the Variables panel. You can also provide a description of the variable's function.

<figure><img src="https://2428652681-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsB9HAei8v4FfKkH9M4gw%2Fuploads%2FFOl73fqtrLcKjs2hfOIc%2Fimage.png?alt=media&#x26;token=d1707b4e-6ecf-4c3d-ba5c-82ce4b0140ab" alt=""><figcaption><p>Display the variable in the side pane</p></figcaption></figure>

After you create variables, the variables side pane is displayed. Users can input values for calculations, apply filters, and trigger scripts with variable controls from this side pane.

<figure><img src="https://2428652681-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsB9HAei8v4FfKkH9M4gw%2Fuploads%2FBKlEzKy4FZ9PQ0xGcuOX%2Fimage.png?alt=media&#x26;token=653bdd21-5a21-4268-8da1-649bbb3ad8f8" alt=""><figcaption><p>Use variables from the side pane</p></figcaption></figure>

## 2. Referencing variables in functions

You can create a calculated measure that references the value set in a variable. Each variable has a **Technical Name** that can be referenced in formulas.

<figure><img src="https://2428652681-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsB9HAei8v4FfKkH9M4gw%2Fuploads%2FQmSofh3yPFa2wvlR3J7n%2Fimage.png?alt=media&#x26;token=b829d22b-0071-4e87-b891-ab797818a229" alt=""><figcaption><p>Technical name of variable</p></figcaption></figure>

In this example, the calculated measure, Revenue, will change based on the boolean variable.

<figure><img src="https://2428652681-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsB9HAei8v4FfKkH9M4gw%2Fuploads%2Fxs4XmQQHIXNZYmcmVFGr%2Fimage.png?alt=media&#x26;token=1dbda005-da75-4ac5-83b4-95a794712c82" alt=""><figcaption><p>Using variables in calculations</p></figcaption></figure>
