Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
WEBINAR June 25, 2025: Build on Apache Iceberg with Qlik Open Lakehouse - REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
fsilva1
Contributor II
Contributor II

sum values group by ID

Hi guys,

I have a table with ID, Suppliers, and Values. In the front end, I need to sum the Values by ID desconsidering suppliers. I tried to use sum(Aggr(sum(Values),ID)), but it is not correct. How can I do this? In this example, I need to show 100 because ID 1100 has a value of 100 and not 200.

 

image (8).pngimage (7).png

 

 

1 Solution

Accepted Solutions
ramchalla
Creator II
Creator II

Hi,

in that case, you can use the below formula. Please find the attached qvw.

Sum(Aggr(Max(Sales), ID))

 

View solution in original post

5 Replies
ramchalla
Creator II
Creator II

Hi,

Please let me know what should be the value displayed for the ID 1200. should it be 200 or 500?  I can try and let you know the fix for this.

 

 

fsilva1
Contributor II
Contributor II
Author

First of all, thank you for your answer..

Sorry, that was my mistake. Sales are based on ID, so for each ID, we have the same sales figure. Therefore, the correct sales amount for ID 1200 is 200.

ramchalla
Creator II
Creator II

Hi,

in that case, you can use the below formula. Please find the attached qvw.

Sum(Aggr(Max(Sales), ID))

 

BrunPierre
Partner - Master
Partner - Master

Are you considering the very first recorded sales figure for each ID?

Then try;

=Sum(Aggr(FirstSortedValue(sales, Aggr(Sum(sales), ID)), ID))

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

If you just want to show values then dont use measure but use values as dimensions both for ID and for Value. 

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.