Template:Jam occurrence leaderboard/query: Difference between revisions

From VNDev Wiki
okay, let's see whether this logic works
 
m format with table if not transcluded
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ask: [[Jam occurrence:+]]
<noinclude><table></noinclude>{{#ifexpr: {{Jam occurrence leaderboard/tiecalc|rank={{{1|1}}}|date={{{date|Jan 1 2100}}} | vnOnly={{{vnOnly|}}} | for={{{for|entries}}} | format=number }} < 21 |
|?=jam
  <tr><td>{{Jam occurrence leaderboard/tiecalc|rank={{{1|1}}}|date={{{date|Jan 1 2100}}} | vnOnly={{{vnOnly|}}} | for={{{for|entries}}} | format=display }}</td>
|?Has entries=entries
  <td>{{Jam occurrence leaderboard/prop | date={{{date|Jan 1 2100}}} | vnOnly={{{vnOnly|}}} | for={{{for|entries}}} | offset={{#expr: {{{1|1}}}-1}} | simple=no}}</td>
|template=Jam occurrence leaderboard/row
  <td>{{PAGENAME:{{Jam occurrence leaderboard/prop | date={{{date|Jan 1 2100}}} | vnOnly={{{vnOnly|}}} | for={{{for|entries}}} | offset={{#expr: {{{1|1}}}-1}} | prop=name }} }}</td>
|format=plainlist
  </tr>
|sort=Has entries
|}}<noinclude></table></noinclude>
|order=descending
|limit=1
|link=none
|searchlabel=
|offset={{{1}}}
|named args=yes
<!-- The below section calculates the correct rank number by comparing to prior items  -->
|userparam={{#ifexpr: {{{1}}} = 1 | 1 |
    {{#ifexpr: {{#ask: [[Jam occurrence:+]] |?Has entries|format=plainlist|sort=Has entries|order=descending|limit=1|link=none|searchlabel=|offset={{{1}}} }}
      = {{#ask: [[Jam occurrence:+]] |?Has entries|format=plainlist|sort=Has entries|order=descending|limit=1|link=none|searchlabel=|offset={{#expr: {{{1}}}-1}} }}
      | <!--At least two way tie; now test for three way tie-->
        {{#ifexpr: {{#ask: [[Jam occurrence:+]] |?Has entries|format=plainlist|sort=Has entries|order=descending|limit=1|link=none|searchlabel=|offset={{{1}}} }}
          = {{#ask: [[Jam occurrence:+]] |?Has entries|format=plainlist|sort=Has entries|order=descending|limit=1|link=none|searchlabel=|offset={{#expr: {{{1}}}-2}} }}
          | Three-way tie
          | Two-way tie
        }} <!--end if for three-way tie-->  
      | <!--Not a tie or is first instance of a tie-->Not tie
    }} <!--end if for two-way tie-->
  }} <!--end if for param is 1-->
}}

Latest revision as of 09:04, 25 January 2025

1 272 Spooktober 2024