Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

let and set difference

hi friends

what is the meaning of let and set in the qlikview??

and point out the differences in them in detail?

1 Solution

Accepted Solutions

let and set difference

Hi,

     Let: Calculates the expression assigned to it and sets the expression result to the variable.

     Set: Assigns the value(or expression which is after the equal sign) as it is without compute.

Example:

     Set vVar=2+3; //vVar has the expression 2+3 as value we have to compute it using $(vVar) which returns 5

     Let vVar=2+3;//vVar has the computed value 5

Hope it helps

Celambarasan

View solution in original post

8 Replies

let and set difference

Hi,

     Let: Calculates the expression assigned to it and sets the expression result to the variable.

     Set: Assigns the value(or expression which is after the equal sign) as it is without compute.

Example:

     Set vVar=2+3; //vVar has the expression 2+3 as value we have to compute it using $(vVar) which returns 5

     Let vVar=2+3;//vVar has the computed value 5

Hope it helps

Celambarasan

View solution in original post

Highlighted
Not applicable

let and set difference

Hello,

there is a pretty good explanation in the Qlikview Help:

The let statement has been created as 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 ' =' before it is assigned to the variable.

The word let may be omitted, but the statement then becomes a control statement. Such a statement without the keyword let must be contained within a single script row and may be terminated either with a semicolon or end-of-line.

Examples:

Set x=3+4;

Let y=3+4

z=$(y)+1;

$(x) will be evaluated as ' 3+4 '

$(y) will be evaluated as ' 7 '

$(z) will be evaluated as ' 8 '

Highlighted
MVP & Luminary
MVP & Luminary

let and set difference

Hi,

SET just assigns the value as string whatever you give.

LET evaluates the expresion and assigns it to the variable.

LET vString = 'Qlik' & 'View'  (Now vString has QlikView)

LET vNumber = 2 + 3 (Now vNumber has5)

Hope this helps you

Regards,

Jagan.

Highlighted
Not applicable

let and set difference

thnx

Highlighted
Not applicable

Re: let and set difference

k thanks but what happen when i write

let a=b+7?

can any one say it...

thanks

Praveen

Highlighted
Not applicable

Re: let and set difference

thanx

Highlighted
tuongnguyen
New Contributor II

Re: let and set difference

Set x=3+4;

Let y=$(y)*3

z=$(y)


So my question is


z will be  3+4*3 = 15  or  (3+4) *3 = 21

Highlighted
stevewithington
New Contributor

Re: let and set difference

I realize this post is a bit dated, however there was a really good post in the Qlik Design Blog addressing this very question in great detail which I personally found quite helpful: The Magic of Variables

Cheers!