Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of Multiple Variables

Dear All,

Unable to sum two variables. Please assist.

I have tried the following after Creating a  new variable V_tester in the Variables Overview

V_tester = $(Var_1) + $(Var_2)

andl

V_tester = Var_1 + Var_2

This is in Qlikview and not in the script.

Please sugesst how do I add.

With regards

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

One of the fastest ways of debugging your expressions and variables is by using an INPUT BOX. The input box can show several variables at once and any type of QlikView expression can be written and evaluated directly in an input box.

Create a new input box and add your three variables like this:

2017-01-08 13_34_25-QlikView x64 - [QV1].png

2017-01-08 13_34_40-QlikView x64 - [QV1].png

2017-01-08 13_35_19-QlikView x64 - [QV1].png

Then you can immediately inspect all three variables and modify them to see what it evaluates to.

Example - if you have the two variables Var_1 and Var_2 populated with 456 and 890:

2017-01-08 13_38_08-QlikView x64 - [QV1].png

2017-01-08 13_38_31-QlikView x64 - [QV1].png

It might seem like your variables don't evaluate to numbers - thus adding them together will not give you a numeric result - possibly and error. Like this:

2017-01-08 13_41_25-QlikView x64 - [QV1].png

For me Input Box is an invaluable aid in getting my expressions correct and saving a lot of time while debugging them.

View solution in original post

4 Replies
vinieme12
Champion III
Champion III

Try below

V_tester = $(=Var_1) + $(=Var_2)

or

=rangesum( $(=Var_1) , $(=Var_2))

please also post expression for these two variables if the issue persists

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
petter
Partner - Champion III
Partner - Champion III

One of the fastest ways of debugging your expressions and variables is by using an INPUT BOX. The input box can show several variables at once and any type of QlikView expression can be written and evaluated directly in an input box.

Create a new input box and add your three variables like this:

2017-01-08 13_34_25-QlikView x64 - [QV1].png

2017-01-08 13_34_40-QlikView x64 - [QV1].png

2017-01-08 13_35_19-QlikView x64 - [QV1].png

Then you can immediately inspect all three variables and modify them to see what it evaluates to.

Example - if you have the two variables Var_1 and Var_2 populated with 456 and 890:

2017-01-08 13_38_08-QlikView x64 - [QV1].png

2017-01-08 13_38_31-QlikView x64 - [QV1].png

It might seem like your variables don't evaluate to numbers - thus adding them together will not give you a numeric result - possibly and error. Like this:

2017-01-08 13_41_25-QlikView x64 - [QV1].png

For me Input Box is an invaluable aid in getting my expressions correct and saving a lot of time while debugging them.

jagan
Partner - Champion III
Partner - Champion III

Hi,

What are the values you are getting in the two variables Var_1 + Var_2?   Check it by using Text Objects or by using Input boxes.

If you are getting one of the variable value as Null, then better use RangeSum()

=RangeSum(Var_1, Var_2)

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Dear Petter,

Thanks for the method used... This assists in the overall development perspective a lot.

Thanks also to Jagan and Vineet...