Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Recover the maximum value in a table

Hello or hello again,

Do you know if it is possible to recover the maximum value for counting and for what mode the maximum is reached. (in a table).

Thank you.

1 Solution

Accepted Solutions
sunny_talwar

Assuming your Dimension name is SECTEURS, try this:

=Max(Aggr(Count([No product]), SECTEURS))

View solution in original post

12 Replies
Gysbert_Wassenaar

Something like max(aggr(count( SomeField ), Dim1, Dim2,..., DimN)) where Dim1, Dim2, ..., DimN the dimensions are over which the count is calculated.


talk is cheap, supply exceeds demand
Not applicable
Author

I would like to retrieve it in a text object.

I enter &max (aggr (count (SECTORS) [NumProduct])) & but it makes me value 1.

sunny_talwar

Try this may be:

FirstSortedValue(Aggr(Count(SECTORS), NumProduct), -Aggr(Count(SECTORS), NumProduct))

Not applicable
Author

This does returns nothing.

sunny_talwar

Would you be able to share a sample?

Not applicable
Author

A sample of? Table?

The table is the following :

echantillon tableau.PNG

The formula for 205 and 190 is : count([No product])

sunny_talwar

Assuming your Dimension name is SECTEURS, try this:

=Max(Aggr(Count([No product]), SECTEURS))

Not applicable
Author

Thank you very much, It recovers the maximum. But is it possible to get to what sector it has reached the maximum?

sunny_talwar

Sure:

Try this:

=FirstSortedValue(SECTEURS, -Aggr(Count([No product]), SECTEURS))