# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Valued Contributor III

## Show max with help of Aggr()

Hi Folks,

i got a case, my table does look  the following (please see attached screenshot),

i want to show the sum (Bestand) in depending on max of (W_Zeit)

for example:

Artikelnr   W_Zeit   Bestand

1500          280          300

1500          280          350

1500          240          120

1600          140           45

1600          140           64

1600          120           100

Output should look like this:

Artikelnr   W_Zeit   Bestand

1500          280          650

1600          140          109

i am using this expression: sum(aggr(sum({<W_Zeit = {"\$(=MAX(W_Zeit))"}>}Bestand),Artikelnr)) but it does not work

does anybody have any idea, how to resolve this issue

Thanks a lot

Beck

1 Solution

Accepted Solutions
MVP

## Re: Show max with help of Aggr()

May be try this

FirstSortedValue(Aggr(Sum(Bestand), Artikelnr, W_Zeit), -Aggr(W_Zeit, Artikelnr, W_Zeit))

5 Replies
MVP

## Re: Show max with help of Aggr()

May be try this

FirstSortedValue(Aggr(Sum(Bestand), Artikelnr, W_Zeit), -Aggr(W_Zeit, Artikelnr, W_Zeit))

Valued Contributor III

## Re: Show max with help of Aggr()

Good Morning Sunny,

again you saved my day, thanks a lot for your time and help

Thanks a lot

Beck

Valued Contributor III

## Re: Show max with help of Aggr()

Hi Sunny

your solution does work great. i have a question.

how can i show the total sum of my value, now i have only the max value 650 as sum, how can i show 1196 as sum of my values (please see attached screenshot)

Beck

MVP

## Re: Show max with help of Aggr()

Try this

Sum(Aggr(FirstSortedValue(Aggr(Sum(Bestand), Artikelnr, W_Zeit), -Aggr(W_Zeit, Artikelnr, W_Zeit)), Artikelnr))

Valued Contributor III

## Re: Show max with help of Aggr()

Sunny thanks a lot for your help and time

it does work great