Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
AyCe1082
Creator
Creator

Force show most repeated text value in straight table when there is more than one value

Hi I am looking to modify a straight table to fix a null appearing.  The table has Players, their most common Position over a set number of a competition's Rounds. All three fields are text values.

 

Mode won't work because some will have two Positions as their most repeated. I have tried working with firstsortedvalue and aggregates but can't come to a solution. If it is possible to work this in an expression instead of the load script that would be best, but I would use the script if there is no other way.

Here is a small table to show the data. The main table will have just one row per player and doesn't show rounds.

 

AyCe1082_1-1639760489324.png

 

3 Replies
Or
MVP
MVP

If a player has two positions that are equally frequent, what is the expected result? That seems to be your problem with using existing functions, but you haven't actually defined the logic for what you want to see in that scenario...

Have a look at this thread for a similar scenario, where the requirement was to concatenate the most frequent values. You can probably work off that to come up with any other required result.

https://community.qlik.com/t5/New-to-Qlik-Sense/Concatenate-Results-if-FirstSortedValue-is-a-Tie/m-p...

 

AyCe1082
Creator
Creator
Author

I must have deleted that part when I was editing my comment. In each row, the table has to show any of the tied Positions, doesn't matter which one, instead of Null. I will have a look at that link thanks.

Vegar
MVP
MVP

Maybe this blog post might be of interest. 

Computing the Mode in a Multimodal dataset