Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. April 17 - 20, 2023, in Las Vegas! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
chriys1337
Creator II
Creator II

Calculated Variable

Hi,

I would like to hand over the value of one variable to another, and tried it with following let statement, which does not work?

(vCountry_Count = 1)

LET vPeeking = $(vCountry_Count);

Additinal question, once this is working I would like to  deduct -1 from Country_Count in the vPeeking Variable.

1 Solution

Accepted Solutions
rwunderlich

(vCountry_Count = 1)

is not a valid script statement and will return a null result. A valid statement would be without the () and an added; 

vCountry_Count = 1;

This defaults to LET and I recommend you explicitly code either LET or SET.  There is no need to favor LET over SET unless you are calculating an expression.  So a valid set of statements would be:

SET vCountry_Count = 1;
SET vPeeking = $(vCountry_Count);

And to subtract 1 from vPeeking:

LET vPeeking = $(vPeeking) - 1;

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

 

View solution in original post

2 Replies
rwunderlich

(vCountry_Count = 1)

is not a valid script statement and will return a null result. A valid statement would be without the () and an added; 

vCountry_Count = 1;

This defaults to LET and I recommend you explicitly code either LET or SET.  There is no need to favor LET over SET unless you are calculating an expression.  So a valid set of statements would be:

SET vCountry_Count = 1;
SET vPeeking = $(vCountry_Count);

And to subtract 1 from vPeeking:

LET vPeeking = $(vPeeking) - 1;

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

 

Anil_Babu_Samineni

Perhaps this?

Set vCountry_Count = 1;

LET vPeeking = $(vCountry_Count)-1;

 

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)