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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get total value from a chart

Hello all,

I would like to ask you if there is a way to get value from the chart.

As you can see on screenshot, I need that red and green value.

To calculate those in load script is not possible, since data in that chart is divided in several tables.

Is there a way to store those values in variables, and use them for some other calculations?

Best regards

3 Replies
Anil_Babu_Samineni

Yes, Using TOTAL Keyword in your expression

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sam_grounds
Contributor III
Contributor III

Yes, use the expression from the chart in a text object, or pre-calculate it in a variable and you'll get the total.

There is a difference between...

Let vBonus = '=sum(Bonus)';

and

Let vBonus = 'sum(Bonus)';

...in a variable (above shows how to write them into your script, you could just do this in the variable overview instead, CTRL + ALT + V). If you use the equals, you'll get the value and if you put that in a chart it'll show the same value all the way down, however the one without the equal will write that expression and calculate a different value for each row.

To reference the variable elsewhere use

$(vBonus)

You could do other calculations like variance in your chart.

sum(Bonus)-$(vBonus)

...would give you the variance versus the overall total.

Hope this helps.

Sam

sunny_talwar

May be something like this

Sum(Aggr(YourExpression, YourDimension))