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 from expression of straight table (macro or other solution)?

How can I get the total of these columns. I need it to build a pie chart with these values.

Is it possible to get these data with the macro? Or is there some other solution. The picture below.

Thanks!

5 Replies
giakoum
Partner - Master II
Partner - Master II

sum({$<[ABC]={"A,B,C"}>} [Sales])

jagannalla
Partner - Specialist III
Partner - Specialist III

Hello,

Add another expression and give A+B+C. It just work like Column1 + Column2 + Column3. If you don't want to see the expressions A, B & C just hide those expressions.

Cheers!

Jagan

Not applicable
Author

i need total A, total B and total C in other chart. Or variable vA=787085, vB=... or vC...

giakoum
Partner - Master II
Partner - Master II

if you need total A, total B and total C without dimensions, then this is the expression to go :

sum({$<[ABC]={"A","B","C"}>} [Sales])

or

sum({1<[ABC]={"A","B","C"}>} [Sales])  . This one disregards selections.

If dimensions are involved, this needs to be aggregated using the aggr function.

whiteline
Master II
Master II

sum({$<[ABC]={"A"}>} [Sales])  - total A

sum({$<[ABC]={"B"}>} [Sales])  - total B

sum({$<[ABC]={"C"}>} [Sales])  - total C

if you also want discard the user selections use {1 istead of {$.