Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Aggr/Max Question

I have a data set similar to this:

IDDateStdDayValue
A1/1/20141100
A1/2/2014250
A1/3/201435
B3/5/20141200
B3/6/2014250
C4/1/20141500
C4/2/20142400
C4/3/20143300
C4/4/20144100
C4/5/2014540

I need a formula that would return the sum of the 'Value' for the maximum 'StdDay' for each 'ID'.  The result for this example should be 5+50+40 = 95. 

Any ideas?

Thanks

1 Solution

Accepted Solutions
jerem1234
Valued Contributor II

Re: Aggr/Max Question

Try:

sum(aggr(firstsortedValue(Value, -StdDay), ID))

Hope this helps!

3 Replies
jerem1234
Valued Contributor II

Re: Aggr/Max Question

Try:

sum(aggr(firstsortedValue(Value, -StdDay), ID))

Hope this helps!

MVP
MVP

Re: Aggr/Max Question

maybe

=sum(aggr(FirstSortedValue(TOTAL <ID> Value, -StdDay),ID) )

ecolomer
Honored Contributor II

Re: Aggr/Max Question

Both answer are ok

Attached the QV

Community Browser