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: 
rafaeloneil
Contributor III
Contributor III

Pivot Table Percentage

Hello Everyone, good afternoon, I mounted this Pivot Table:

PivotTable.png

But must group calculate the percentage for the subtotal indicated like this :

 

Prod%
00.00%
00.00%
00.00%
00.00%
12.08%
36.25%
714.58%
918.75%
2858.33%
48100%

These are my expressions :

Prod: SUM(QTDMOT)

%: QTDMOT/Sum(QTDMOT)

They could assist me ?

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Sum(QTDMOT)/Sum(TOTAL <DTCONTRATO, DsFilial> QTDMOT)

Tested this on a sample

Table:

LOAD * Inline [

Dim, Dim2, Date, Value

A, AA, 01/01/2016, 10

A, AB, 01/01/2016, 30

B, BB, 01/02/2016, 20

B, BA, 01/02/2016, 90

A, AA, 02/01/2016, 40

A, AB, 02/01/2016, 20

B, BB, 02/02/2016, 60

B, BA, 02/02/2016, 30

];

Capture.PNG

View solution in original post

5 Replies
MK9885
Master II
Master II

Have you check 'Show Partial Sums' for all of your dimensions in Presentation Tab?

neelamsaroha157
Specialist II
Specialist II

Try Sum(QTDMOT)/Sum(Total <DTCONTRATO> QTDMOT)

rafaeloneil
Contributor III
Contributor III
Author

Hi,


I tried the 2 suggestions but did not reach my goal.


I changed the expression of percentage for this :
SUM ( QTDMOT ) / Sum ( TOTAL < DsMotivo , DsFilial > QTDMOT )
PivotTable.png
It is now almost certain , only that the calculation is performed accounting every month .
It must be calculated by individual total each month and respecting the dimension =MonthName(DTCONTRATO)

sunny_talwar

Try this:

Sum(QTDMOT)/Sum(TOTAL <DTCONTRATO, DsFilial> QTDMOT)

Tested this on a sample

Table:

LOAD * Inline [

Dim, Dim2, Date, Value

A, AA, 01/01/2016, 10

A, AB, 01/01/2016, 30

B, BB, 01/02/2016, 20

B, BA, 01/02/2016, 90

A, AA, 02/01/2016, 40

A, AB, 02/01/2016, 20

B, BB, 02/02/2016, 60

B, BA, 02/02/2016, 30

];

Capture.PNG

rafaeloneil
Contributor III
Contributor III
Author

Perfect ! It worked I appreciate the help of all !