Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sebastian_marti
Contributor II
Contributor II

Sum in a pivot table

Hi, in a pivot table I have one field with values 1, 2 and 3.

I want to divide one amount field by SUM(amount) when field value = 1, for each value (1,2,3).

DescriptionTotals% Sales
Sales1000100%
Cost50050%
Other Cost20020%

Thanks in advance

Sebastian

1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum(Value)/Sum(TOTAL {<Description = {'Sales'}>} Value)

View solution in original post

20 Replies
sunny_talwar

May be this

Sum(Value)/Sum(TOTAL {<Description = {'Sales'}>} Value)

sebastian_marti
Contributor II
Contributor II
Author

Wonderful!

It's works!

Thank you

sebastian_marti
Contributor II
Contributor II
Author

In a pivot table, "Totales" column is the total amount of Account. % Sobre Venta is Totales divided by Totales when Account = "Ingresos".

When two years are choosen, the % value is distributed across each year, example: in "Ingresos" line, % values are 16.84% and 83.16%, both sumarized values totals 100%.

I need that each value represent the % belongs its year. In this case, both column must be 100% (100% for 2017 and 100% for 2018).

The table looks like this:

I really appreciate your support.

Best regards,

Sebastián Martínez

sunny_talwar

Then try this

Sum(Value)/Sum(TOTAL <YearField> {<Description = {'Sales'}>} Value)

sebastian_marti
Contributor II
Contributor II
Author

It works!!!

Thanks a lot!

sebastian_marti
Contributor II
Contributor II
Author

Dear Friend,

I need your help one more time.

I got this problem. I made a difference between two years but i want to show the measure in the end of the table.

I need this solution: (paint)

Please help me!

sunny_talwar

May be approach it like this

Chart Expression | Qlik Community

sebastian_marti
Contributor II
Contributor II
Author

Hi Sunny, in that link you included one file called "GSD_Value_Scorecard_v1.qvw" but is impossible to open it.

Could you explain in simple words how it works the function/formula?

Thanks,

sebastian_marti
Contributor II
Contributor II
Author

Isn't work because the colum still appear in 2018.