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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I Sum a Value for Another Distict Value?

How do I sum the total leg empty miles for distinct leg values? The answer should be 292 for this dataset. I tried this but it is only counting.

sum(aggr(count(distinct([TMW leg#])),TotalLegEmptyMiles))

TMW leg#

TotalLegEmptyMiles

263226

0

260442

93

260442

93

260442

93

260377

0

260294

0

260293

25

260278

0

260264

20

260263

73

260262

31

260261

25

260260

17

260257

8

292

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Are you looking for

sum(aggr( Only(TotalLegEmptyMiles), [TMW leg#] ))


?



View solution in original post

2 Replies
swuehl
MVP
MVP

Are you looking for

sum(aggr( Only(TotalLegEmptyMiles), [TMW leg#] ))


?



Not applicable
Author

Thank you SO much!!!!