Max of count

  

Hi guys,

I'm doing a polling system and in my aggregate I get the number of votes per nomination with a group by nomination and count in the ID as you can see below.

I need to display the max of the count values, which would be 2 in this case. How should I go about getting that max value. Having some problems.

Kind Regards 

Werner

Hi Werner,

Set the order by to the Count, high to low. Return the top 1 query and return the value you receive.

Kind regards,

Remco Dekkinga

Remco Dekkinga wrote:

Hi Werner,

Set the order by to the Count, high to low. Return the top 1 query and return the value you receive.

Kind regards,

Remco Dekkinga


Sorry I'm a bit of a noob, what does "Return the top 1 query and return the value you receive" mean?


Solution

Hi Werner,

Check the following image:

I added a Sorting on the Count column and I added a Max. Records of 1, which results in a query with just 1 line

When consuming this query, you can use QueryName.List.Current.Count to get the value of the first line.

Kind regards,

Remco Dekkinga

Solution