7 Replies Latest reply: Feb 21, 2011 4:13 PM by Ralf Becher

# pivot formula sum

Hi Qlikview community,

unfortunately I can not make the pivot chart sum formula columns. As an alternative, I'm the sum of outside output.

How can I sum a formula column in the pivot chart, outside? See screenshot. Thank you!

Best regards,

• ###### pivot formula sum

Hi,

have you tried the AGGR function?

- Ralf

• ###### pivot formula sum

Hi Ralf,

I am grateful for any help. I do not see how I could do with a AGGR function. Thank you!

Here are my qvw file.

Best regards,
Onur

• ###### pivot formula sum

Hi Onur,

this should do:

`= 'Totalprice PLAN IST: ' & money(sum(aggr(sum( [HEL_DATA_Imps mit Defaults] ) * (SAL_OPPORTUNITYLINEITEM_UnitPrice), SAL_OPPORTUNITYLINEITEM_UnitPrice)))`

- Ralf

• ###### pivot formula sum

Thank you very much.

Thats it

• ###### pivot formula sum

Hi Ralf,

there is an another isue with your formula --> http://community.qlik.com/forums/t/41287.aspx

Have you an any idea ? Thank you !

Best Regards,

• ###### pivot formula sum

Hi Onur,

the problem is that Set Analysis will not work on your expression because it only works on functions like SUM. You have to rewrite your expression to avoid the multiplication outside the SUM function like this:

`= 'Totalprice PLAN IST: ' & sum({1} aggr({1} sum({1} [HEL_DATA_Imps mit Defaults] * SAL_OPPORTUNITYLINEITEM_UnitPrice), SAL_OPPORTUNITYLINEITEM_UnitPrice))`

This example will calculate the wrong figure in your case I guess. But, it shows how the Set Analysis would work.

- Ralf

• ###### pivot formula sum

You need to enable "partial sums" on the dimension for a pivot to show total (presentation tab), usually just the last dimension will do.

Outside the pivot you need to tell it how you want to aggregate the second field as you will have more than one entry. You've told it to sum the first field and the second field looks like an item cost field so should qv sum them all up together too then multiply the two sums?