Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
the-null
Contributor III
Contributor III

Calculate the sum of a column within a pivot table

Within the table, I have data for customers indicating the amount within the year 2022. I want to add another column that will calculate the total amount within the year for each customer.

Labels (5)
1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

You can tty

=Aggr(Sum({<Year={'2022'}>} Amount), Customer)

 

View solution in original post

5 Replies
theoat
Partner - Creator III
Partner - Creator III

Good afternoon,

You can use the fonction aggr. For example :
=aggr(sum(Iznos2022),Kupac naziv).

Note that it is preferable to use a numeric ID_client.

Kind regards,
Théo ATRAGIE.

the-null
Contributor III
Contributor III
Author

Thank you for the help, but I'm still not getting the correct data.

 

There seems to be an issue because not all amounts for the year 2022 are being summed and subtracted from the amounts per customer.

theoat
Partner - Creator III
Partner - Creator III

Hello,

Here, the aggregation is done for the Kupac field.
If you do it on the Kupac Naziv field, I think the aggregation will give the result you expect.

Kind regards,
Théo ATRAGIE.

mato32188
Specialist
Specialist

Hi @the-null ,

I would suggest you to use customer field first in a pivot table, turn the Show Total - On for the customer dimension and use sum(Iznos2022). 

If you want to have different view, just drag and drop fields in pivot table...I would suggest simple solution with a bit of teaching users how to use pivot table features in Qlik.

Br

Martin

ECG line chart is the most important visualization in your life.
Chanty4u
MVP
MVP

You can tty

=Aggr(Sum({<Year={'2022'}>} Amount), Customer)