Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

FirstSortedValue Not showing First "TOP USER" in textbox

Hi Guys,

FirstSortedValue Not showing First "TOP USER" in textbox when two users have the same value.  For example if Tom has 10 sessions and Harry has 9, my top user will display Tom, which is correct.  If Tom and Harry both have 10, it doesn't show no one.

I've come across this before but it will take the first sorted by alphabet, how can i sort this out to only show one user?

Regards

='TOP USER: ' & FirstSortedValue([Name], -aggr(count( Session), [Name]))

1 Solution

Accepted Solutions
Highlighted

Re: FirstSortedValue Not showing First "TOP USER" in textbox

Apologizes, I forgot to add closing parenthesis for Rank function

='TOP USER: ' & FirstSortedValue([Name], -aggr(Count( Session) + Rank([Name])/1E10, [Name]))

or

='TOP USER: ' & FirstSortedValue([Name], -aggr(Count( Session) - Rank([Name])/1E10, [Name]))

View solution in original post

19 Replies
Highlighted

Re: FirstSortedValue Not showing First "TOP USER" in textbox

May be this:

='TOP USER: ' & FirstSortedValue([Name], -aggr(Count( Session) + Rank([Name])/1E10, [Name]))

not sure if it needs to be + or -, try both

='TOP USER: ' & FirstSortedValue([Name], -aggr(Count( Session) - Rank([Name])/1E10, [Name]))

Highlighted
Creator III
Creator III

Re: FirstSortedValue Not showing First "TOP USER" in textbox

That's giving me an error in the expression

Highlighted
Champion II
Champion II

Re: FirstSortedValue Not showing First "TOP USER" in textbox

it may be because you have more than one customer with the same weight / rank , FirstSortedvalue will return null in that case

Highlighted
Creator III
Creator III

Re: FirstSortedValue Not showing First "TOP USER" in textbox

I know that bit, I'm trying to resolve how to sort it, possibly by sorting by alphabet.

Highlighted

Re: FirstSortedValue Not showing First "TOP USER" in textbox

Apologizes, I forgot to add closing parenthesis for Rank function

='TOP USER: ' & FirstSortedValue([Name], -aggr(Count( Session) + Rank([Name])/1E10, [Name]))

or

='TOP USER: ' & FirstSortedValue([Name], -aggr(Count( Session) - Rank([Name])/1E10, [Name]))

View solution in original post

Highlighted
Creator III
Creator III

Re: FirstSortedValue Not showing First "TOP USER" in textbox

Thanks Sunny T, yet again

Happy New Year Guys

Highlighted

Re: FirstSortedValue Not showing First "TOP USER" in textbox

Happy New Year!!

Highlighted
Master II
Master II

Re: FirstSortedValue Not showing First "TOP USER" in textbox

Sunny,

You are dividing  Rank([Name]) / 1E10 and what does 1E10 refers to ?

Thanks

Highlighted

Re: FirstSortedValue Not showing First "TOP USER" in textbox

1E10 = 1/10,000,000,000 (1 divided by 10,000,000,000)