Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kushalthakral
Creator III
Creator III

Can LET can be used as SET in qlikview script

Dear All

is there anyway we can use LET function as SET function in script

Regards

Kushal Thakral

6 Replies
marcus_sommer

I think you want something like this:

set eLoadStart = "num(now() - today(), '#.########', '.', ',')";

let vLoadStart = $(eLoadStart);

- Marcus

simenkg
Specialist
Specialist

For the most part, Yes.

You can write:
let vTest = 'sum(Amount)';

or

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.

Not applicable

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

kushalthakral
Creator III
Creator III
Author

hi all

actually

i have created two variables using set and let

set vtest='today()';

let vtest1=today();

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

its_anandrjs

Hi,

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.

Ex:-

SET vNowSet = 'NOW()'; //This gives NOW()

LET vNowLet = $(vNowSet); //This gives Current date and time value

Regards

Anand

kushalthakral
Creator III
Creator III
Author

Hi Anand

Thanks for your input but somebody ask this question to me in an interview that how can we use let functionality in set functions

Regards

Kushal Thakral