Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot table % of Total

How is a "% of total column" done in a pivot table?

I know how to do this using a straight table, but we need a pivot table.

The 1st column will be Product family,
the 2nd column will be Sum(Sales) and
the 3rd column will be % of total Sales.

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

Hi danhilz,

You have to put in the expression of the third column:

Sum(Sales) / Sum(TOTAL Sales)

Maybe it works

View solution in original post

9 Replies
Not applicable
Author

Hi danhilz,

You have to put in the expression of the third column:

Sum(Sales) / Sum(TOTAL Sales)

Maybe it works

pkelly
Specialist
Specialist

=Sum(Sales) / Sum(TOTAL Sales)

Think the above should work for you...

Not applicable
Author

Thank worked.

Thanks.

alwinsch
Creator
Creator

Hi,

Since i'm new to QV

and i found this correct answer... but unfortunately i doesn't work for me.

could you help me please?

I attached the QV document.

kind regards,

Alwin

Not applicable
Author

Hi Alwin,

Your code syntax was wrong, correct syntax attached

Regards

Kulbir

alwinsch
Creator
Creator

Hi kulbir,

Sorry for my late response.

And first of all thanks for the help, but when i paste your syntax in my QVW file

it gives me an error:

=sum([Totaal v/h Jaar]) / sum(TOTAL [Totaal v/h Jaar])

It says that the Fieldname is not correct.

But it is correct!

Kind regards.

Alwin

Not applicable
Author

Alwinsch,

are you sure that you're not using the Label instead of the Field name as in the file you attached earlier? Try and open the Edit Expression dialog, and select the field you want to use in the drop-down list furthest down on the dialog, and hit the paste button where you want it to go.

Regards

S

alwinsch
Creator
Creator

Fseijsing,

Yes i'm sure it is not in the label:

the label says : 'Aandeel in portefeuille '

I cannot select the fields, because it is already an expression.

I can type in the beginning of the expression and intellisense does the rest...

so i know it is the correct way to write the variable... because it is case sensitive

regards,

A.

alwinsch
Creator
Creator

Hi all,

I solved it!

Changed pivot table to a normal table

and then i could use the 'Relative' option.

Regards,

Alwin