5 Replies Latest reply: Aug 30, 2012 9:59 AM by whiteline _

# 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!

• ###### Re: Get total from expression of straight table (macro or other solution)?

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

• ###### Re: Get total from expression of straight table (macro or other solution)?

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

• ###### Re: Get total from expression of straight table (macro or other solution)?

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.

• ###### Re: Get total from expression of straight table (macro or other solution)?

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 {\$.

• ###### Re: Get total from expression of straight table (macro or other solution)?

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