Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

maxstring with two possible values

Hi guys! I'm using the maxstring() function to get the maximum read book of a list, and it works well.

The problem is that sometimes I got more than one possible row, and I have the maximum value in a textbox and the same metric in a straight table, and not always they are at the top position.

Do you know how to fix it? Here you have an image explaining what I'm saying.

MaxString.png

Regards, Marcel.

5 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Instead of MaxString() have you tried Rank() or FirstSortedValue()?

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Yes, and it didn't work. In the forum the people recommended me using maxstring to get my goal.

The problem is that when I have two books with the same value, I found no way to put an "order by" clause.

Regards, Marcel.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Can you post a sample app?

Clever_Anjos
Employee
Employee

Try something like,

If two or more books share the same rank, the first one in alphabetical order will be returned

=FirstSortedValue(Book,-Aggr(Sum(Sales)+rank(Book,Book)/10,Book))

tresesco
MVP
MVP

May be like sample attached ?

Expression like: =MaxString(Aggr(If(Rank(Sum(Amt))=1,Str),Str))