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

Max function on straight table

Hi,

I'm attempting to use the max function as an expression to return the highest id but the expression always seems to return null for each record.

For example: these 3 users have the same data on each contract but 789 is the most recent so this is the only record I need.

User and Id are dimensions and the others are expressions.

User Id Number of Sites Remaining Used
3 100 500
AB 456 1 100 500
CD 789 1 100 500
EF 123 1 100 500

So what I would need is for the table to look like this:

User Id Number of Sites Remaining Used
3 100 500
CD 789 1 100 500


Does anyone know how to achieve this? Any help is much appreciated.

Thanks

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Straight table:

Dimension: User

Exp1: Max(Id)

Exp2: FirstSortedValue([Number of Sites], -Id)

Exp3: FirstSortedValue(Remaining, -Id)

Exp4: FirstSortedValue(Used, -Id)

View solution in original post

3 Replies
tresesco
MVP
MVP

Straight table:

Dimension: User

Exp1: Max(Id)

Exp2: FirstSortedValue([Number of Sites], -Id)

Exp3: FirstSortedValue(Remaining, -Id)

Exp4: FirstSortedValue(Used, -Id)

Not applicable
Author

Hi Ashley,

Please give contract as dimension and give the above expressions.

PFA

Warm Regards,

Joshmi

rubenmarin

Hi Ashley, another option can be change Id dimension to a calculated dimension like:

=Aggr(If(Id=Max(TOTAL Id), Id), Id)

Checking "Supress when value is null".