# Variables

## Excel

Select a cell/range of cells > go to the **Formulas** tab > **Defined Names** > **Name Manager** (or hold `Ctrl+F3`) and assign a name to the selected cell. In the future, you can refer to the value of the cell/cells by typing the chosen name.

## Tableau

Right-click in the **Data Window** > **Create Parameter**. In the popup, provide a parameter name and specify (a) the data type for the values it will accept, (b) the current value, and (c) input options.

## Alteryx

Use the **Parameter Control** tool (in the **Input** palette), which acts as the input for each iteration of a Batch Macro and will appear as a `¿` on the macro tool icon. \
\
&#x20;![](https://3800670130-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4uObfHWvsn0aAfuifV%2F-M4uOfElaTa53MyrD8KZ%2F-M4uOvKxyLlJSHvlIZxw%2FParameter%20tool.PNG?generation=1586896554311610\&alt=media)

NB. The Control Parameter must have an Action associated with it, such as _Update Value_, _Update Input_, or _Update Output Actions_. For each record coming into the Control Parameter input, the entire macro will be re-configured and run beginning to end.

## OrgVue

var ‹variable\_name› = ‹expression›

```
// Variables
var a = 1;
var sal = node.salary;
var nv = node.value;

// Uses
a == 2; // Returns 'true'
sal*1.2
nv['Bonus'];
```

NB. Consider the different uses of the `=` symbol. In this case:

* `a = 2` **assigns** the value '2' to the variable 'a'
* `a == 2` tests the **equality** of 'a', ie returns 'True' if 'a' equals '2'
* `a === 2` tests the **identity** of 'a', which in this case will return 'False' because, although 'a' and '2' have the same _value_, they are different entities.

## tSQL

\~DECLARE!\~ ‹parameter\_name› «type»\
&#x20;\~SET!\~ ‹parameter\_name› = ‹expression›

```
DECLARE EmpIDVar INT
SET EmpIDVar = 1234

SELECT *
FROM EmployeesData
WHERE EmployeeID = EmpIDVar
```

## Python

‹variable\_name› = ‹expression›

```
a = 1;
salary = 100000;
comp = salary*1.2;
```
