Wednesday 22 February 2012

SET vs. LET

I got into a conversation with someone today who was struggling to understand the difference between SET and LET. It wasn't the first time I've had this conversation so thought I'd explain it here too in case any QV newbies were also struggling with it.

SET is taken literally and what is on the right of the equals is written into the variable. So writing:

SET vMyVariable = 5*2;

Would result in vMyVariable containing "5*2".

LET is used when you wish QlikView to equate what is on the right of the equals and write the answer into the variable. So writing:

LET vMyVariable = 5*2;

Would result in vMyVariable containing "10".

Simples!

1 comment: