Author Topic: Formula for the smallest point score in top 20 scores  (Read 1366 times)

Borsk

  • Newbie
  • *
  • Posts: 8
    • View Profile
Formula for the smallest point score in top 20 scores
« on: January 14, 2013, 03:43:43 PM »
Hi

We have a league that award points to everyone in a tournament.

We play 52 tournaments a year but only the 20 best scores count.

I got the formular for that one.

But i can't get the "easy" one....

I want to know what my smallest score of my top 20 is

Help?

Thanks

Borsk

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5380
    • View Profile
Re: Formula for the smallest point score in top 20 scores
« Reply #1 on: January 15, 2013, 10:11:14 AM »
Overall Scores formula:

top(20, scores)

Borsk

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Formula for the smallest point score in top 20 scores
« Reply #2 on: January 15, 2013, 11:09:51 AM »
Darn, thats what i though... for some reason everyone gets result 0 except a few guest players who only played once, they get their "best" score

Any ideas why ?

Borsk

TIMMER

  • Hero Member
  • *****
  • Posts: 555
    • View Profile
Re: Formula for the smallest point score in top 20 scores
« Reply #3 on: January 15, 2013, 11:28:07 AM »
It's something like this, numberOfTournaments is the number of tournaments from which statistics are being computed.  But each player could have played in numberOfTournaments or fewer (as few as 1) tournaments.  So you have to use the number of scores (from the Tournament Score formula) to determine how many tournaments the player has participated in.

if(count(scores) > 20, bottom(1, scores), 0)
 
 
 
 

Borsk

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Formula for the smallest point score in top 20 scores
« Reply #4 on: January 15, 2013, 11:39:17 AM »
Not sure i understand completely

If i use that formular if(count(scores) > 20, bottom(1, scores), 0)

I get a result for all players i think....

It might be the smallest score they have made entirely but not their buttom score in the top 20 scores..

My results are like 2 4 and 6 points normally over a year a player have the smalles score around 16-30

Borsk

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5380
    • View Profile
Re: Formula for the smallest point score in top 20 scores
« Reply #5 on: January 17, 2013, 12:42:17 PM »
Sorry, I goofed.  But you also didn't say how you want to compute the player's overall score from those top 20.  I'll assume you want to sum them up:

sum(top(20, scores))

The issue is that scores is a special variable that contains all of the player's score values (one for every tournament in which they played); I call it a "list" variable (in programming languages it would be an "array").  The function top() also returns a list.  But the Overall Score needs to be a single value, not a list.  So top(20, scores) returns a list, which is no good for Overall Score, so it defaults to "0".  But for players who only played in a single tournament, the list returned by top(20, scores) has only one value, which technically isn't good for Overall Score, but it's good enough.

Borsk

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Formula for the smallest point score in top 20 scores
« Reply #6 on: April 19, 2013, 05:47:13 AM »
Hi Corey

Thank you for your help on the sum(top(20, scores)) that works.

I just really can't get the 2nd part working.

I try to explain again :)

Lets say i have played in 30 tournaments and scored each time.  I would like to know the bottom scores of the top 20.

I might be way off, but i tried this
if(count(scores) > 20, bottom(20, scores), 0)

Sorry, i'm a noob :)

Borsk

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5380
    • View Profile
Re: Formula for the smallest point score in top 20 scores
« Reply #7 on: April 19, 2013, 11:54:53 AM »
No worries, looks like you're doing OK.

Quote
I would like to know the bottom scores of the top 20.

I'm confused by this.  You want to know the bottom scores of the top 20?  Just want to make sure I'm reading that correctly.

You didn't specify how many of the bottom scores, or what to do with them.

So, for example, do you want to know the lowest score of the top 20 scores?  You could do that like this:

bottom(1, top(20, scores))

That would show the lowest score of those top 20 scores.  But you have to do something with it if you want more than 1 score, since the entire formula must return only a single value.  For example:

bottom(3, top(20, scores))

This would error, because it returns 3 values and the Overall Score must be a single value.  But this would work:

sum(bottom(3, top(20, scores)))

So, what are you looking for?

Borsk

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Formula for the smallest point score in top 20 scores
« Reply #8 on: April 21, 2013, 04:48:22 PM »
Hi again

Thanks for your help... the first one was spot on.

Perhaps if i had explained the purpose you would have understod much better.

The idea with the "result" we get is to have the lowest score of the top 20 results, so you know how many points you need to enhance your general standing in the league.

Thanks again

Borsk