Qlik Community

Qlik Sense App Development

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

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

aggr sum in both lines of hierarchie

Hi community,

I need help with AGGR & SUM:

  • I have the following simplified table (black).
  • The Aggr function (red) i tried: sum(aggr(sum(distance), ID, Line)) 
  • In green is the expted result. Sum of distance for every combination of  ID & Line combination
IDLinePositiondistanceAGGR functionexpected result
7913110.00010.60010.600
79132600-10.600
47121917917917
47131917917917

 

Thanks for your help in advance! 🙂
Swen

Labels (4)
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

This?

sum(aggr(NoDistinct sum(distance), ID, Line)) 

Or,

SUm(Total <ID, Line> distance)

View solution in original post

2 Replies
Highlighted
MVP
MVP

This?

sum(aggr(NoDistinct sum(distance), ID, Line)) 

Or,

SUm(Total <ID, Line> distance)

View solution in original post

Highlighted
Partner
Partner

SUm(Total <ID, Line> distance) works fine on a first look.

I did not think that it could work without aggr() 😉