For versions prior to v2.1.1, Qlik Sense does not provide the option to define variables outside the script as you could in the Variable Overview window in Qlikview. With v2.1.1, Qlik has introduced a new variable interface that enlists the existing variables created in the script and also provides the user with the option to create new variables.
For the purpose of this recipe,we will make use of an inline data load which gives the sales information for four countries:
Create a new Qlik Sense application and call it
QS_Variables
.Load the following script in the application:
Sales: LOAD * INLINE [ Country, Sales,COS USA, 1000,500 UK, 2000,1000 France, 3000,2500 Germany, 4000,4700 ]; Let vRedColor=RGB (255, 0, 0); Let vSales= 'Sum(Sales)';