Discussion Board for collaboration related to QlikView App Development.
As you can see in the Reference Manual, they are used to assign values to variables in the load script. The main difference is that while SET assigns the value to the variable without evaluation, as a string, the LET first evaluates the expression at the right part of the "=" sign, then stores the value.
Two simple examples:
SET vLiteral = 1 + 1; // This stores the string "1 + 1";
LET vSum = 1 + 1; // This stores 2
Hope that helps.
Let and Set commands are used to define Script Variables. Any text or numeric value can be assigned to the script variables.
Set V = $ ; ( Set- assigns the variable(V) the text(String) to the right of the equal sign)
Let vStart = num(makedate(2011)); (Let- evaluates the expression)
Set MUL = ’$1*$2’;
Set X = $(MUL(3,7)); // returns '3*7' in X
Let X = $(MUL(3,7)); // returns 21 in X
See the example like
Let T=now( );
It will give you exact time because the value of now( ) return value assign to Let T variable and it retun time value.
Set P=now( );
But SET will give and return the now( )
means what ever you write for code it accept it as string
It is very simple:
using SET you are adding string value to a variable
variable value is '4+5'
using LET you are adding an expression result to a variable
variable value is 9
In Qlikview there are two variable SET and LET.The difference between these two is that the SET statement assigns literal string to SET variable,where LET Statement first evaluate the string before assigning it
Statement Value of variable
Set aVariable= 2+3; 2+3;
Let bVariable = 2+3; 5;