Discussion Board for collaboration on QlikView Scripting.
is there anyway we can use LET function as SET function in script
I think you want something like this:
set eLoadStart = "num(now() - today(), '#.########', '.', ',')";
let vLoadStart = $(eLoadStart);
For the most part, Yes.
You can write:let vTest = 'sum(Amount)';
set vTest = sum(Amount);
they are both evaluated when your write $(vTest) in your application.
I'm more unsure of the syntax:
Set vTest = =sum(Amount)
As far as i know, writing:Let vTest = '=sum(Amount)';
will not give the same results.
What are you trying to achieve and why would you want to do this?
The simple answer to this would be no.
The LET statement evaluates the expression on the right side of the '=' before it is assigned to the variable, the SET will assign the text on the right hand side of the '='.
SET V1 = 1+2; Returns 1+2
SET V2 = 1+3; Returns 3
i have created two variables using set and let
in the variable overview screen i am getting today() and 02/12/2014
but i actually want same output in both means 02/12/2014
LET and SET are different when you define any value in the SET it treat as string and what ever we write it is string. But if ay assigning in the LET its value calculate and assign to the variable.
SET vNowSet = 'NOW()'; //This gives NOW()
LET vNowLet = $(vNowSet); //This gives Current date and time value
Thanks for your input but somebody ask this question to me in an interview that how can we use let functionality in set functions