Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

beck110979
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
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
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))

beck110979
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

beck110979
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)

case solution.PNG

Beck

MVP
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))

beck110979
Valued Contributor III

Re: Show max with help of Aggr()

Sunny thanks a lot for your help and time

it does work great