Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

sebastian_marti
New 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

Re: Sum in a pivot table

May be this

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

20 Replies

Re: Sum in a pivot table

May be this

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

sebastian_marti
New Contributor II

Re: Sum in a pivot table

Wonderful!

It's works!

Thank you

sebastian_marti
New Contributor II

Re: Sum in a pivot table

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

Re: Sum in a pivot table

Then try this

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

sebastian_marti
New Contributor II

Re: Sum in a pivot table

It works!!!

Thanks a lot!

sebastian_marti
New Contributor II

Re: Sum in a pivot table

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!

Re: Sum in a pivot table

May be approach it like this

Chart Expression | Qlik Community

sebastian_marti
New Contributor II

Re: Sum in a pivot table

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
New Contributor II

Re: Sum in a pivot table

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

Community Browser