Skip to content

Commit

Permalink
Fix best potential fmc mean (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
campos20 authored Oct 1, 2024
1 parent 0d3ddaf commit 5849c84
Showing 1 changed file with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ queries:
- Attempt 2
- Attempt 3
- Competition
- Round
showPositions: true
positionTieBreakerIndex: 0
sqlQuery: |-
select format((r1 + r2 + r3) / 3, 2) average,
select
format((r1 + r2 + r3) / 3, 2) average,
r1,
r2,
r3,
wca_statistics_competition_link_format(competitionId, cellName)
from (
select competitionId,
wca_statistics_competition_link_format(competitionId, c.cellName),
rt.name
from
(
select
competitionId,
roundTypeId,
min(
case
when value1 > 0 then value1
Expand All @@ -33,17 +39,25 @@ queries:
else null
end
) r3
from Results
where eventId = '333fm'
group by competitionId
from
Results
where
eventId = '333fm'
group by
competitionId,
roundTypeId
) best_results
inner join Competitions c on best_results.competitionId = c.id
where r1 is not null
inner join RoundTypes rt on rt.id = best_results.roundTypeId
where
r1 is not null
and r2 is not null
and r3 is not null
order by convert(average, float4),
order by
convert(average, float4),
competitionId
limit 20
limit
20
sqlQueryCustom: |
select
coalesce(format((r1 + r2 + r3)/ 3, 2), 'DNF') average,
Expand All @@ -64,7 +78,7 @@ queries:
eventId = '333fm'
and competitionId = ':COMPETITION_ID'
group by
competitionId) best_results
competitionId, roundTypeId) best_results
title: Best potential FMC mean
explanation: The means are computed by taking the best result for each attempt in the given round.
groupName: Events

0 comments on commit 5849c84

Please sign in to comment.