Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Variable

Hi

Is it possible to create a variable in the script and assign the respective value in the front end .

Thanking You

Vinayagam

9 Replies
anbu1984
Honored Contributor III

Re: Variable

Re: Variable

yes

try this:

LET myVar = 100;

... in the front end you can use fo example

Sum({$ <myField={$(myVar)}>}myVal)

prodanov
Contributor

Re: Variable

Hi,

     Of course, you can. All variables, which you create in the process of loading are available in layout and the all variables, which you create in layout are available in the script.

Regards

Dimitar

sujeetsingh
Honored Contributor III

Re: Variable

Yes you can. But why to do this you can create one from Variable in document properties and set and event/action in UI to update its value.

MVP
MVP

Re: Variable

Hi,

check this link

http://community.qlik.com/blogs/qlikviewdesignblog/2014/11/24/the-equal-sign

Hope it helps you.

Regards,

Jagan.

Highlighted
qv_testing
Valued Contributor

Re: Variable

Hi Vinay,

We can do both sdies  (Scripting and Designing)

we have 2 types of variables SET and LET

Using SET you are adding string value to a variable
SET Variable1='4+5';
returns variable value is= '4+5'

using LET you are adding an expression result to a variable
LET Variable1=4+5;
returns variable value is=  9

Hope you understand..................

Re: Variable

Hi,

Yes and in front end you can assign the value to variable by the help of the input box.

In Script

Let xVar = 0;

In front end by input box enter any value by using this variable.

Or you can check Henric Explanation

http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables

Regards,

Anand

Not applicable

Re: Variable

Thank you All for the instance reply

But is it possible to do it in the below mentioned way

Let Vest=0;

Load

Date1,

Amt,

Date2(Vest)

From ,,,,,,

And the pass the value to the variable  using  calendar object;