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
Not applicable
Author

I know ,"it doesnt work is not an answear" but If I could elaborate more I would. Nevertheless, I updated my qvw file. I want to select the maximum value on all cells.

Anonymous
Not applicable
Author

I hope it helps, see text box in the attached.

Not applicable
Author

Hi Pedro,

you can try with these two ways:

FIRSTSORTEDVALUE (OrderDate, – aggr(sum(Sale)) )


or


=Max ( aggr ( sum ( Sale ),OrderDate ) )

Not applicable
Author

Can you give me the code? I dont have a lincese on wlikview. At least for now.

Thanks in advance

Anonymous
Not applicable
Author

I added a text box with this:

=max(aggr(sum(Numbers), Weekday,Month))

It returns the largest value in the table: 228,22917519802

Not applicable
Author

The first solution doesnt work.

The secound gives the wrong output.

Not applicable
Author

But how can I put that value inside of the table. Do you know how can I accomplish that?

Anonymous
Not applicable
Author

Too bad you can't open the file...  Well, first change your expression in the table to this:

if(secondarydimensionality()=1, sum(Numbers), max(aggr(sum(Numbers), Weekday,Month)))

That means you'll have different expressions for regular columns and for total, depending on dimensionality.  Next, on Presentation tab, select Weekday, check "Show Partial Sum", and label for total change to "Max" or something like that.

Not applicable
Author

Try with Pedro

FIRSTSORTEDVALUE (OrderDate, – aggr(sum(Sale)), OrderDate )

Not applicable
Author


There is something wrong with that expression.