Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
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
MVP
MVP

Re: Max function on straight table

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
MVP
MVP

Re: Max function on straight table

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

Not applicable

Re: Max function on straight table

Hi Ashley,

Please give contract as dimension and give the above expressions.

PFA

Warm Regards,

Joshmi

Re: Max function on straight table

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".