Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Store formulas in variable

Hi all,

I am very new in Qlik, and I would like to know how to give my users predefined formulas that they can use in their expressions. For example, I want to create a variable named sum_qty = "sum(QTY)" and I want my user to use sum_qty in his expression, but I am not able to get it to work.

Thank you in advance

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Store formulas in variable

Define the variable in one of two ways:

1. In the script:

SET sum_qty=sum(QTY);

2. In the Variable overview dialog.

Users then reference the variable in an expression as:

$(sum_qty)

-Rob

8 Replies
MVP & Luminary
MVP & Luminary

Store formulas in variable

Define the variable in one of two ways:

1. In the script:

SET sum_qty=sum(QTY);

2. In the Variable overview dialog.

Users then reference the variable in an expression as:

$(sum_qty)

-Rob

Not applicable

Store formulas in variable

Hi Carlo, you can store the expressions in an xl spreadsheet and read these expressions in your script.

Store formulas in variable

Hi,

Yes you can

make a variable named QTY_SUM = Sum(QTY)

And use this variable in any expression like  $(QTY_SUM)

Rgds

Anand

Re: Store formulas in variable

Hi,

See the sample file

Rgds

Anand

Not applicable

Store formulas in variable

Thank you all very much, I was not able to reference the variable in the expression

Regards

Re: Store formulas in variable

Hi,

You can use any type of formulas like Max,Min,Sum,Count etc

See the attached sample file.

Rgds

Anand

Re: Store formulas in variable

Hi,

You have to use the values of stored variables in expression like

See the attached sample file

Rgds

Anand

Not applicable

Re: Store formulas in variable

It would be a good idea to check the way you are defining the variables and the way you are using them as qv is case-sensitive. It maybe something as small as this that maybe hampering the ref.