Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of Columns in Pivot table

Hi all, I'm not sure if I'm missing a trick but I have a requirement where I have to show the Sum of measures of a row in a Pivot table but with dimensions going across and the measures going down, e.g.

Pivot_Structure.PNG

Any help appreciated!

Many thanks

1 Solution

Accepted Solutions
Digvijay_Singh

See if this can help.

Capture.JPG

View solution in original post

12 Replies
oknotsen
Master III
Master III

Go to the Presentation tab and in the top-left corner, turn on "Show Partial Sum".

You might need to play a bit with on which dimension to turn this on before you figured out which is the correct one.

May you live in interesting times!
Saravanan_Desingh

Are you using the Sales as Dimension or Customer?

The first Table shows Customer as Dimension and the second shows Sales.

I hope you have not Transposed the Dimension to Column.

If possible, please upload the App.

Not applicable
Author

Hi, thanks for the reply, however I did already try this but it simply moves back the Dimensions from column format (across the top) back to row format, I think it needs maybe another Expression to be used as a Total of all values for a row but really not sure.

Kushal_Chawda

Create the the Expression Total  using column(1)+column(2)

Now you cab simply drag the expression to Column and drag the dimension to raw if you are using pivot table

Digvijay_Singh

See if this can help.

Capture.JPG

Not applicable
Author

Hi, the original source data is in the format of the second table (i.e. Company Name being a column, not a Dimension), however on import I have modeled it correctly having Company as Dimension and sales as measures, the problem is I still need to display it in the old format having Company as Columns and the sales measures appearing in Row format.

I currently have this Pivot chart in Qlikview but just can't get the Total to show as the last row so summing all sale types per company.Pivot.PNG

Not applicable
Author

Many thanks guys, I was hoping not having to hard code all the fields as I have about 20-30 of them but it does look like in this instance I'm rather limited on solutions.

I've got a macro which creates the chart anyhow so will just try added some extra logic to create the Total expression field.

Cheers!

oknotsen
Master III
Master III

Not sure what you mean with "hard code all fields"?

May you live in interesting times!
Not applicable
Author

Well in my fact I have lets say 20 expressions, to sum all of them wouldn't I need to add each field name by hard coding the field names or doing  Column(1) + Column(2) .., or is there a dynamic way of doing this, something like

=concat('if(isnull([' & [FieldName] & ']),0,' & '[' & [FieldName] & ']' & ')' & ' + ')

Thanks!