Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate the maximum value

Hi everyone,

I have a dimension and I want to calculate the maxium value from my data. In the example I saw it says it should be calculated by the following expression:

$(=max(aggr(sum(sales), OrderDate)))


I already tried but I didnt get any successful result. Can someone help me out?

How can I calculate the maximum in the expression where the data has different dimension but I want to calculate the maximum value from all my data. I read it can be calculated using the expression $(=)

Any thoughts?

20 Replies
Anonymous
Not applicable
Author

You need to use rank-function to find out maxium value. Expression is something like this:

=date(max(aggr(if(Rank(Sum(sales))=1, OrderDate),OrderDate)))

anbu1984
Master III
Master III

Try this expr

=max(aggr(sum(sales), OrderDate))

Not applicable
Author

It isn't working. You put the date, but I want the value, but even though I remove the date it doesnt work.

Not applicable
Author

It doesnt work.

anbu1984
Master III
Master III

Can you post sample data.

What are the dimensions used in the chart?

Anonymous
Not applicable
Author

Are you using it inside of set analysis? Then expression is like this

YourDateField={"(=max(aggr(if(Rank(Sum(sales))=1, OrderDate),OrderDate)))"}

dieter13
Contributor II
Contributor II

Try this:

=FirstSortedValue(sales,-OrderDate)

Anonymous
Not applicable
Author

Pedro,

You have to explain better and/or to upload an example.  The expression you show is returning maximum daily sales (by order date).  Is it what you need?  You say "didn't get any successful result" but you have to tell what the expectation is.
And "it doesn't work" isn't an explanation either

Thanks,
Michael

Not applicable
Author

Hi,

You can try this expressions.

$(=max(aggr(sum({<OrderDate= >} sales ))))

                       OR

$(=max(aggr(sum({<OrderDate= >} sales ),any one dimension field)))