Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
kbhasinptc
Contributor
Contributor

Need help on using Max function in expression

I have two fields in data Id and sales. I am trying to take sum of sales for maximum value of ID but it is giving me sum only for 1 maximum id value which is at the last. the expression I am using is as below:

Sum({$<id={"$(=max(id))"}>}sales)

5 Replies
sunny_talwar

May be you need this

FirstSortedValue(Aggr(Sum(Sales), id), -id)

devarasu07
Master II
Master II

Hi,

method 1:

=FirstSortedValue(ID,-Sales)


method 2:

=max(aggr(sum(Sales),ID))


vishsaggi
Champion III
Champion III

Also try this May be?

= Max(Aggr(Sum(Sales), Id))

shiveshsingh
Master
Master

Max(aggr(sum(sales),ID))

isingh30
Specialist
Specialist

Please check the screenshots.

Let me know.

Thanks.