Hi,
I am trying to order a list of athletes based on their results in the contests they all participate in throughout the year but I am getting stuck on 2 points:
1) ordering them based on the total points they gained while using the positions they occupied as tiebreaker criteria (i.e. if they have the same points the one with more #1 spots will be ahead, if they're equal the differentiation continues with #2 spots, #3 spots and so on).
2) displaying the positions they occupied while ignoring the positions they did not occupied (i.e. 1 P1, 2 P2 instead of 1 P1, 2 P2, 0 P3, 0 P4, 0 P5...)
Here's a practical example just so you'll see the data:
<table border="0" cellpadding="0" cellspacing="0" width="456"><col style="width: 64pt;" width="85"> <col style="width: 37pt;" span="3" width="49"> <col style="width: 47pt;" width="62"> <col style="width: 61pt;" span="2" width="81"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt; width: 64pt;" height="17" width="85">
</td> <td class="xl25" style="width: 37pt;" width="49">Contest 1 - position</td> <td class="xl26" style="width: 37pt;" width="49">Contest 1 - points</td> <td class="xl25" style="width: 37pt;" width="49">Contest 2 - position</td> <td class="xl26" style="width: 47pt;" width="62">Contest 2 - points</td> <td class="xl25" style="width: 61pt;" width="81">Contest 3 - position</td> <td class="xl26" style="width: 61pt;" width="81">Contest 3 - points</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl29" style="height: 12.75pt;" height="17">Athlete 1</td> <td class="xl27" align="center">1</td> <td class="xl28" align="center">5</td> <td class="xl28" align="center">3</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl29" style="height: 12.75pt;" height="17">Athlete 2</td> <td class="xl27" align="center">2</td> <td class="xl28" align="center">4</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">7</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl29" style="height: 12.75pt;" height="17">Athlete 3</td> <td class="xl27" align="center">2</td> <td class="xl28" align="center">4</td> <td class="xl28" align="center">3</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">4</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl29" style="height: 12.75pt;" height="17">Athlete 4</td> <td class="xl27" align="center">3</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">6</td> <td class="xl28" align="center">3</td> <td class="xl28" align="center">2</td> </tr> </tbody></table>
<table border="0" cellpadding="0" cellspacing="0" width="295"><col style="width: 37pt;" width="49"> <col style="width: 50pt;" width="67"> <col style="width: 64pt;" width="85"> <col style="width: 71pt;" width="94"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt; width: 37pt;" height="17" width="49">
</td> <td class="xl25" style="width: 50pt;" width="67">Overall - position
</td> <td class="xl25" style="width: 64pt;" width="85">Overall - points</td> <td class="xl26" style="width: 71pt;" width="94">Overall - position history</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt;" height="17">Athlete 1</td> <td class="xl28" align="center">4</td> <td class="xl28" align="center">9</td> <td class="xl29">1 P1, 1 P2, 2 P3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt;" height="17">Athlete 2</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">14</td> <td class="xl29">1 P1, 2 P2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt;" height="17">Athlete 3</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">9</td> <td class="xl29">1 P1, 1 P2, 1 P3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt;" height="17">Athlete 4</td> <td class="xl28" align="center">3</td> <td class="xl28" align="center">10</td> <td class="xl29">2 P2, 1 P3</td> </tr> </tbody></table>
Thanks in advance !
I am trying to order a list of athletes based on their results in the contests they all participate in throughout the year but I am getting stuck on 2 points:
1) ordering them based on the total points they gained while using the positions they occupied as tiebreaker criteria (i.e. if they have the same points the one with more #1 spots will be ahead, if they're equal the differentiation continues with #2 spots, #3 spots and so on).
2) displaying the positions they occupied while ignoring the positions they did not occupied (i.e. 1 P1, 2 P2 instead of 1 P1, 2 P2, 0 P3, 0 P4, 0 P5...)
Here's a practical example just so you'll see the data:
<table border="0" cellpadding="0" cellspacing="0" width="456"><col style="width: 64pt;" width="85"> <col style="width: 37pt;" span="3" width="49"> <col style="width: 47pt;" width="62"> <col style="width: 61pt;" span="2" width="81"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt; width: 64pt;" height="17" width="85">
</td> <td class="xl25" style="width: 37pt;" width="49">Contest 1 - position</td> <td class="xl26" style="width: 37pt;" width="49">Contest 1 - points</td> <td class="xl25" style="width: 37pt;" width="49">Contest 2 - position</td> <td class="xl26" style="width: 47pt;" width="62">Contest 2 - points</td> <td class="xl25" style="width: 61pt;" width="81">Contest 3 - position</td> <td class="xl26" style="width: 61pt;" width="81">Contest 3 - points</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl29" style="height: 12.75pt;" height="17">Athlete 1</td> <td class="xl27" align="center">1</td> <td class="xl28" align="center">5</td> <td class="xl28" align="center">3</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl29" style="height: 12.75pt;" height="17">Athlete 2</td> <td class="xl27" align="center">2</td> <td class="xl28" align="center">4</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">7</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl29" style="height: 12.75pt;" height="17">Athlete 3</td> <td class="xl27" align="center">2</td> <td class="xl28" align="center">4</td> <td class="xl28" align="center">3</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">4</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl29" style="height: 12.75pt;" height="17">Athlete 4</td> <td class="xl27" align="center">3</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">6</td> <td class="xl28" align="center">3</td> <td class="xl28" align="center">2</td> </tr> </tbody></table>
<table border="0" cellpadding="0" cellspacing="0" width="295"><col style="width: 37pt;" width="49"> <col style="width: 50pt;" width="67"> <col style="width: 64pt;" width="85"> <col style="width: 71pt;" width="94"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt; width: 37pt;" height="17" width="49">
</td> <td class="xl25" style="width: 50pt;" width="67">Overall - position
</td> <td class="xl25" style="width: 64pt;" width="85">Overall - points</td> <td class="xl26" style="width: 71pt;" width="94">Overall - position history</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt;" height="17">Athlete 1</td> <td class="xl28" align="center">4</td> <td class="xl28" align="center">9</td> <td class="xl29">1 P1, 1 P2, 2 P3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt;" height="17">Athlete 2</td> <td class="xl28" align="center">1</td> <td class="xl28" align="center">14</td> <td class="xl29">1 P1, 2 P2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt;" height="17">Athlete 3</td> <td class="xl28" align="center">2</td> <td class="xl28" align="center">9</td> <td class="xl29">1 P1, 1 P2, 1 P3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt;" height="17">Athlete 4</td> <td class="xl28" align="center">3</td> <td class="xl28" align="center">10</td> <td class="xl29">2 P2, 1 P3</td> </tr> </tbody></table>
Thanks in advance !