8 Replies Latest reply: Apr 27, 2014 12:06 AM by Sunil Chauhan

# Rank an aggregated count

Hi

I'm sure this is pretty simple but I cannot seem to get my head around it

I have a variable vCount:  aggr (count ({1}race_time),race_distance, temp, altitude)

What I want to achieve is to take the race_time values that make up the aggregate and then rank them from lowest to highest. E.g:

race_timerank
9.854 / 4
9.581 / 4
9.753 / 4
9.652 / 4

Any help greatly appreciated.

Thanks

Matt

• ###### Re: Rank an aggregated count

Hi,

Use the Rank(\$(vCount))

Regards,

Kaushik Solanki

• ###### Re: Rank an aggregated count

Thanks for the response.  Rank(\$(vCount)) returns:

1

1

1

1

in the rank field.

If I just specify the variable it displays the correct count so I'm not sure why I'm seeing these results.

• ###### Re: Rank an aggregated count

Hi,

• ###### Re: Rank an aggregated count

Thanks for the reply but I only have QV Personal so cannot view this

Apologies for not specifying this in my original post.

• ###### Re: Rank an aggregated count

try this

Rank(-1 * aggr (count ({1}race_time),race_distance, temp, altitude))

or in variable try this

Rank(-1 *\$(vCount))

• ###### Re: Rank an aggregated count

Thanks for the response.  As with the previous poster these both return:

1

1

1

1

in the rank field.

If I just specify the variable it displays the correct count so I'm not sure why I'm seeing these results.

• ###### Re: Rank an aggregated count

rank(aggr (count ({1}race_time),race_distance, temp, altitude))

hope this helps

• ###### Re: Rank an aggregated count

Simply give a '-' in front of the variable, vCount:  -aggr (count ({1}race_time),race_distance, temp, altitude)

Then use Rank(\$(vCount))