Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
SwenWa
Partner - Contributor II
Partner - Contributor II

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 (2)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

This?

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

Or,

SUm(Total <ID, Line> distance)

View solution in original post

2 Replies
tresesco
MVP
MVP

This?

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

Or,

SUm(Total <ID, Line> distance)

SwenWa
Partner - Contributor II
Partner - Contributor II
Author

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

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