Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare current field value vs column max

Hi guys,

May seem a very simple question to most of you but I am not getting around this.

I have a table with columns A, B, C, D and I what to show values only if the value of the current row of C matches the max value of the column C

so if A, B, C,D

       1, 2, 3, 4

       1, 4, 5, 6

       7,8, 5, 3

I want to show only the last two rows.

Thanks

3 Replies
hic
Former Employee
Former Employee

If you want to do this in the UI, you can create a pivot table with an appropriate dimension - RecNo or something - and use the following expression

  If(Only(C) = Max(total C), <your expression>)

If you want to do this filtering in the script you can use

Table:

Load * From SourceTable (...) ;

Inner Join (Table)

Load Max(C) as C Resident Table;

HIC

Anonymous
Not applicable
Author

You can create a variable that holds maximum value in C column, something like vMaxC=Max(C)

Create a straight chart and display the columns whenever the column value is more than your vMaxC...

vMaxColumn.PNG

Hope this helps.

Regards,

Laxmi

Not applicable
Author

I guess to use it like that one should be careful as when the selection changes the value of the variable changes as well