Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of Maximum Values

Hello,

I am trying to sum the maximum value of a field, and not sure which function to use.

I can get the maximum value without any problems using Max or Maxstring, but when I go to sum those values I run into trouble.

In the example below I want to sum the yellow shaded odomoter readings to get a result of 171,747:

DATE

REGO

ODOMOTER

11/07/2013

108RMK

42436

20/07/2013

108RMK

43004

29/07/2013

108RMK

43572

7/08/2013

108RMK

44140

26/07/2013

109RMK

55334

1/08/2013

109RMK

55895

7/08/2013

109RMK

56456

18/07/2013

110RMK

70081

26/07/2013

110RMK

70616

3/08/2013

110RMK

71151

Any help appreciated.

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

Wayne

If I understand correctly, you could use something like the following expression:

=SUM(AGGR(MAX(ODOMOTER),REGO))

-Clark

View solution in original post

3 Replies
Not applicable
Author

Wayne

If I understand correctly, you could use something like the following expression:

=SUM(AGGR(MAX(ODOMOTER),REGO))

-Clark

View solution in original post

nagaiank
Specialist III
Specialist III

You may use

=Sum(Aggr(FirstSortedValue(ODOMOTER,-DATE),REGO))

Not applicable
Author

Thanks Clark,

That's what I was looking for.

Wayne