Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using expression within a table to find the max of a value

Hi all.

I have a table with the headings "Proposition", "Nominee" and "Nominator".

Nominee and Nominator contain a list of names for each of them.

What I need to do is to write an expression for both Nominee and Nominator that will show the name of the Nominee and Nominator who appear most in the data set, for each proposition.

For example:

Proposition: Techonology

Sally appears 5 times as Nominee, John is mentioned 4 times

Bob appears 7 times as Nominator, Fred is mentioned 10 times

The table should look like the following:

Proposition     Nominee     Nominator

Technology     Sally          Fred

Thanks in advance for your help.

3 Replies
sunny_talwar

May be something like this:

FirstSortedValue(Nominee, -Aggr(Count(Nominee), Proposition, Nominee))

FirstSortedValue(Nominator, -Aggr(Count(Nominator), Proposition, Nominator))

Not applicable
Author

Thanks a lot for this!

The only problem at the moment is that where there are joint first place values neither of them are shown (simply a blank box).

Do you know if there is a way around his?

Thanks again!

sunny_talwar

You can use DISTINCT to show one of them:

FirstSortedValue(DISTINCT Nominee, -Aggr(Count(Nominee), Proposition, Nominee))

FirstSortedValue(DISTINCT Nominator, -Aggr(Count(Nominator), Proposition, Nominator))