Author Topic: Formula Help  (Read 5994 times)

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #15 on: February 07, 2008, 08:44:22 AM »
if i use scores it uses the ranking rather than what points they have

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #16 on: February 10, 2008, 07:23:30 AM »
For example if i have the formula using scores for someone who has played 6 games with 48 points should have 11 league points, but it says 4.***

any help

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5422
    • View Profile
Re: Formula Help
« Reply #17 on: February 11, 2008, 09:55:48 AM »
Post your Tournament Score and Overall Score formulas (again, if you already did).

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #18 on: February 14, 2008, 11:06:21 AM »
Tournament Score
Code: [Select]
switch(r, 1, n,
  2, if(n >= 4, n-2*r, 0),
  3, if(n >= 6, n-2*r, 0),
  4, if(n >= 8, n-2*r, 0),
  5, if(n >= 10, n-2*r, 0),
  6, if(n >= 12, n-2*r, 0),
  7, if(n >= 14, n-2*r, 0),
  8, if(n >= 16, n-2*r, 0),
  9, if(n >= 18, n-2*r, 0),
  10, if(n >= 20, n-2*r, 0))

This works fine

Overall Score

Code: [Select]
if(n >= 5, average(scores) + 0.5*n, 0)

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5422
    • View Profile
Re: Formula Help
« Reply #19 on: February 15, 2008, 10:44:40 AM »
Ok, first let's simplify your Tournament Score formula:

Code: [Select]
if(r == 1, n, if((r < 11) and (n >= r*2), n-2*r, 0))

So, if this works fine for you, I'm failing to see the issue.

The Overall Scoring formula:

Code: [Select]
if(n >= 5, average(scores) + 0.5*n, 0)
.. takes a player's scores, averages them, and multiples it by a factor of 1/2 of the number of tournaments.  What is not working?

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #20 on: February 15, 2008, 11:49:19 AM »
basically that works on their ranking in the tournaments not the points theyve received, so when putting the attribute points in there it comes up with an error and puts all the overall scores to 0

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5422
    • View Profile
Re: Formula Help
« Reply #21 on: February 15, 2008, 01:19:56 PM »
I'm not sure what to tell you.  I just tried it, it works.  I then switch the Tournament Scoring Formula to "points", and it worked, too.

I hate to ask the obvious, but do your players HAVE points?

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #22 on: February 15, 2008, 01:20:50 PM »
yeah they do, ill give it another go later, cheers for your help

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #23 on: February 21, 2008, 09:33:53 PM »
Just thought, I'm meant to be putting this code in Overall Scores yes?

exporting my stats tab to CSV ive posted at the bottom, the overall score formula is if(n >= 5, average(points) + 0.5*n, 0)


Code: [Select]
#,Name,Buy-ins,Hits,Total Cost,Total Winnings,Total Take,Points,League Points
1,Naveen Bhatia,7,2,46.00,107.50,61.50,70.00,0.0000
2,Jason Lloyd,9,3,59.00,108.50,49.50,68.00,0.0000
3,Jack Robinson,8,1,60.00,81.00,21.00,67.00,0.0000
4,ciaran ellis,3,2,19.00,149.50,130.50,64.00,0.0000
5,Tom Cooper,9,2,61.00,85.00,24.00,57.00,0.0000
6,Jahnyah Rose,10,7,64.00,125.00,61.00,51.00,0.0000
7,Andrew Fox,10,1,68.00,70.00,2.00,51.00,0.0000
8,Matt Bennington,7,2,57.00,45.00,-12.00,44.00,0.0000
9,divya patel,9,1,61.00,35.00,-26.00,44.00,0.0000
10,James Browne,4,0,20.00,35.00,15.00,39.00,0.0000
11,Kieran Girvan,3,4,25.00,60.00,35.00,32.00,0.0000
12,Stephen Demergasso,2,0,10.00,10.00,0.00,29.00,0.0000
13,Luke Morgan,2,0,10.00,55.00,45.00,26.00,0.0000
14,Fred Thurgood,6,3,43.00,52.50,9.50,25.00,0.0000
15,Scott Russell,6,1,36.00,15.00,-21.00,24.00,0.0000
16,Malcolm Kotwal,1,0,5.00,20.00,15.00,21.00,0.0000
17,Kieran Butterworth,6,0,40.00,0.00,-40.00,21.00,0.0000
18,Jon Barnes,3,0,21.00,67.00,46.00,21.00,0.0000
19,James Pollock,4,1,30.00,20.00,-10.00,20.00,0.0000
20,Andy Cooper,2,0,15.00,30.00,15.00,19.00,0.0000
21,Adam Bulleid,7,0,42.00,0.00,-42.00,18.00,0.0000
22,Martin Werren,3,1,25.00,10.00,-15.00,17.00,0.0000
23,Tassilo Rukavina,6,0,34.00,5.00,-29.00,16.00,0.0000
24,Matthew Brown,3,2,28.00,24.00,-4.00,16.00,0.0000
25,AB Saraswat,1,0,5.00,0.00,-5.00,15.00,0.0000
26,Stephen Hughes,3,5,25.00,40.00,15.00,13.00,0.0000
27,Ashley Long,8,0,60.00,0.00,-60.00,13.00,0.0000
28,Paul Jones,6,2,42.00,20.00,-22.00,12.00,0.0000
29,Liam Casey,3,0,15.00,10.00,-5.00,12.00,0.0000
30,Brad Prichard,1,0,10.00,5.00,-5.00,12.00,0.0000
31,Daniel Solicari,6,0,52.00,0.00,-52.00,11.00,0.0000
32,Zar Damani,1,2,10.00,15.00,5.00,6.00,0.0000
33,Paul Dennett,4,0,25.00,0.00,-25.00,2.00,0.0000
34,Tom Howells,1,0,5.00,0.00,-5.00,0.00,0.0000
35,Simon Barker,1,0,5.00,0.00,-5.00,0.00,0.0000
36,Ryan Harmer,1,0,7.00,5.00,-2.00,0.00,0.0000
37,Quentin R,1,0,5.00,0.00,-5.00,0.00,0.0000
38,Peter Howe,1,0,5.00,0.00,-5.00,0.00,0.0000
39,Mike Williams,2,0,10.00,0.00,-10.00,0.00,0.0000
40,Laura Noakes,2,0,16.00,0.00,-16.00,0.00,0.0000
41,Kyle Stuart,2,0,10.00,0.00,-10.00,0.00,0.0000
42,jonny baig,1,0,5.00,0.00,-5.00,0.00,0.0000
43,john bailey,1,0,5.00,0.00,-5.00,0.00,0.0000
44,Joe Seals,1,0,5.00,0.00,-5.00,0.00,0.0000
45,Jim Lawell,6,1,45.00,10.00,-35.00,0.00,0.0000
46,Jamie Harland,1,0,10.00,5.00,-5.00,0.00,0.0000
47,Freddy,1,0,5.00,0.00,-5.00,0.00,0.0000
48,Chris Thussan,2,0,15.00,0.00,-15.00,0.00,0.0000
49,chris donze,1,0,5.00,0.00,-5.00,0.00,0.0000
50,Chris Aston,3,0,15.00,0.00,-15.00,0.00,0.0000
51,Catie Dear,1,0,4.00,0.00,-4.00,0.00,0.0000
52,Andy Scraton,1,0,5.00,0.00,-5.00,0.00,0.0000
53,adam bennett,1,0,5.00,0.00,-5.00,0.00,0.0000

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #24 on: February 21, 2008, 09:47:03 PM »
p.s. its named league points but its the same as Overall Score 1

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5422
    • View Profile
Re: Formula Help
« Reply #25 on: February 22, 2008, 07:53:48 AM »
It should be

if(n >= 5, average(scores) + 0.5*n, 0)

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #26 on: February 22, 2008, 09:32:57 AM »
If I used Scores it averages the rank that people came in the tournament, i wanted to use points

Just noticed the formula works on scores not points... if i change the word to points will it recognise it as all i get at the moment is Formula Error

Ignore it.  It's a bug in 2.4.3 that the "points" variable isn't recognized, but it's only in the dialog.  It will still work in the formula itself.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5422
    • View Profile
Re: Formula Help
« Reply #27 on: February 22, 2008, 10:18:47 AM »
This formula:

Code: [Select]
if(n >= 5, average(points) + 0.5*n, 0)
Will never give you anything other than 0.  That's because the "points" variable, while available in the Tournament Scores Formula, is NOT available in the Overall Scores formula.  Therefore, the formula will produce an error and the result will be 0 because of the error.

ALL of the available variables are listed on the dialog in which you input your formula.  So, on the Tournament Scores Formula dialog, you'll see a LOT of variables listed, including "points" (even though using it will display an error in the dialog, as I noted before - that's a specific bug).  On the Overall Formula dialog, you only see "n" or "numberOfTournaments" and "scores".  There is an additional one not listed, "s" or "numberOfScores", but that is because it is simply a shortcut for "count(scores)" and doesn't really hold a unique value.  Those are the only variables available to the Overall Scores formula.

Now, addressing your concern that using "scores" instead of "points" in your Overall Scores formula "averages the rank that people came in the tournament": your Overall Scores formula does exactly what you tell it to do.  The variable "scores" will contain the result of running the Tournament Score formula over each of the tournaments the player played in.  If you want the Overall Score formula to use "points", change the Tournament Score formula to:

Code: [Select]
points


Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #28 on: February 23, 2008, 08:55:08 AM »
Thanks Corey thats much better...

However just noticed an error in the formula.... n is the number of players in a tournament, when I want to be using number of tournaments played... i cant find a variable for this in the help... is there one that i just havent noticed?

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help
« Reply #29 on: February 23, 2008, 09:00:03 AM »
nevermind i got it i shouldve scrolled down half an inch more lol count(scores) =D

Thanks Corey for all your help you've got an amazing program :D