Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
Partner
Partner

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

Re: maxstring with two possible values

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

Partner
Partner

Re: maxstring with two possible values

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.

Partner
Partner

Re: maxstring with two possible values

Can you post a sample app?

Employee
Employee

Re: maxstring with two possible values

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

MVP
MVP

Re: maxstring with two possible values

May be like sample attached ?

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