Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Summing up values from different text objects?

Hi All,

I have a couple of text objects that show how many times different issues show up in the data. Each of those objects has a quite complex count-if expression behind them and outputs one single number.

Example:

     TextObject1: shows how many times x exists

     TextObject2: shows how many times y exists

     TextObject3: shows how many times z exists

     Now I want to have one 'total' text object that sums up what the other text objects show.

     Basically

     TextObject4: =TextObject1 + TextObject2 + TextObject3

Sure, the simplest way would be to repeat all expressions in the fourth object but this would become a very large expression that has to be changed everytime the expression for one of the former objects changes. I'd rather just sum up the former objects.

Is that possible? I can't seem to find how to do that.

Thank You!

Marco

1 Solution

Accepted Solutions
luciancotea
Specialist
Specialist

Use variables. Each object will use one variable and you can make vTOTAL = vOBJ1 + vOBJ2 + vOBJ3

View solution in original post

4 Replies
luciancotea
Specialist
Specialist

Use variables. Each object will use one variable and you can make vTOTAL = vOBJ1 + vOBJ2 + vOBJ3

Not applicable
Author

That sounds like a good idea, I like the idea to have all the expression in one place instead of in many different objects.

I just tried to get one of the formulas into the script and although the script doesn't produce an error, the variable doesn't show up.

I added something like this:

let TestVar1 = count(if(Status=1,LineID));

let TestVar2 = 1234;

The TestVar1 expression works like a charm if I have it as expressioin in the text Object. If I run the script with the above code, TestVar1 does not show up in my list of variables. So I added the line for TestVar2, just to see if the script may stop somewhere before but it doesn't. TestVar2 shows up, just not TestVar1.

Again there is no error message, there are no red squiggly lines under my code - in fact the editor correctly color codes all parts of the expression.

Am I missing something?

luciancotea
Specialist
Specialist

To manage your variables in the interface use Settings -> Variables Overview

Not applicable
Author

I did manually add all variables in the variable manager now. Works like a charm. Thank You!