Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max value in distinct fields of the same record with rank position, just like max function

Hi All,

I have a problem to find a max value in distinct fields of the same record with rank position, just like max function, but in the same record.

LOAD

L1, N1, N2, N3, N4, N5, N6, N7, N8, N9, N10

FROM Table.txt (ansi, txt, delimiter is '\t', embedded labels, msq);

I would like to find the higuest value in N1..N10, the second higuest value, the third higuest value, etc

Thanks

Weber

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Well, it's easy to find the maximum:

rangemax(N1, N2,N3, N4, ),

but you need to literally sort them by value... My recommendation would be to normalize the table (turning each row into 10 rows) and then sort as usual.

You could even combine them back into a single list afterwards, using function concat() - if you really wanted to have a single row with 10 values...

just a thought...

Oleg

Not applicable
Author

Weber, could you please share your solution? I have a similar requirement.

Thanks,

Pavithra