# Let

The let statement is a complement to the set statement, used for defining script variables. The let statement, in opposition to the set statement, evaluates the expression on the right side of the ' =' at script run time before it is assigned to the variable.

Syntax:

Let variablename=expression

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/Let.htm)

#### Examples and results:

| Example | Result |
| --- | --- |
| `Set x=3+4;`<br>`Let y=3+4;`<br>`z=$(y)+1;` | `$(x)` will<br>be evaluated as ' 3+4 '<br><br>`$(y)` will<br>be evaluated as ' 7 '<br><br>`$(z)` will<br>be evaluated as ' 8 '<br><br>Note the difference between the Set and Let statements. The Set statement assigns the string '3+4' to the variable whereas the Let statement evaluates the string and assigns 7 to the variable. |
| Let T=now(<br>); | `$(T)` will be given the value of the current<br>time. |

## Learn more

* [Set](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/Set.htm)
* [Working with variables in the data load editor](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/work-with-variables-in-data-load-editor.htm)