Discussion board where members can get started with Qlik Sense.
I want to create a textbox in which I want to display the name of the individual whose name occurs most often. To do this I use below expression in which 'name' is the column in which the name of the individual is displayed:
FirstSortedValue(name, -Aggr(count([name]), name))
This generates what I am looking for but as soon as there are multiple names with the same max count, the textbox goes empty, indicating that something goes wrong. Any idea how to fix this?
Go to Solution.
If you have multiple and you would want to pick Max(Timestamp), then this
FirstSortedValue(name, -Aggr((Count([name]) + Max(Timestamp)/1E10), name))
Did you try
Concat(Distinct FirstSortedValue(name, -Aggr(count([name]), name)),',')
May be try this
Concat(DISTINCT Aggr(If(Count(Name) = Max(TOTAL Aggr(Count(Name), Name)), Name), Name), ', ')
Thanks for the response! Unfortunately it is not working, 'nested aggregations not allowed'.
This one works! Now it displays all top values though, is it possible to just show the most recent one, so sort on timestamp for example?
May be this
FirstSortedValue(name, -Aggr((Count([name]) + Timestamp/1E10), name))
This is assuming that you have a single timestamp for any given name
Awesome! Could you explain this one to me?
Earlier you were looking for firstsortedvalue (in descending order) based on just the count(Name), I added a little portion of Timestamp by adding Max(Timestamp)/1E10 to determine the sort order