Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

20 Replies
sunny_talwar

I am not entirely sure what you mean, would you be able to share a sample?

sebastian_marti
Contributor II
Contributor II
Author

When I make the KPI (difference between two years) I got a table like this:

But, I need show this table like this:

(This image I edited in paint)

sunny_talwar

What is the expression you used?

sebastian_marti
Contributor II
Contributor II
Author

Sum ( {<[Cuentas_EERR]= {1} >}  [SALDO]) - Before(Sum ( {<[Cuentas_EERR]= {1} >}  [SALDO]))

  • SALDO = Amount of account
  • Cuentas_EERR = Account Clasification

The difference is correct but the format i dont like it.

sunny_talwar

I am 100% sure that you need Pick(Dim(... approach to solve this...

sunny_talwar

And in general the approach is laid out here

Percent of Total in Pivot Table

sebastian_marti
Contributor II
Contributor II
Author

Could you help me with this script?

I will appreciate this. Please

sunny_talwar

I want to... but how? you have not shared a sample

sebastian_marti
Contributor II
Contributor II
Author

Sunny, in the last picture, columns Totales, % Sobre Venta, must be part of Pick(Dim function?

Which values we must specify in the script for Dim? Year dimension? Other value?

We can't understand the reason to use Pick function for this problem.

Pick function choose a value from a list, which values make up the list?

Thanks a lot!