Menu:

Home Articles Custom Crunch
 

Crunches:

Best Crunches
 

Contact:

Email Me
 

Links:

AFL Tables

Welcome to the Hawk Haven

The aim of the Haven is to keep you up to date on all things AFL / Hawthorn from a statistical perspective.

The SQL database has over 4,500 games, stretching all the way back to the 2000 season.

 "Experiment"  Wed Nov 15th, 2023.

Warning: Attempt to read property "num_rows" on bool in /home/darwinet/pageTable.php on line 88
Try

Sorry, no data table was returned from this Crunch.

SET @temp = '', @versus = '', @versus2 = '', @game = 0;

WITH inside AS
(SELECT _when, _rnd, _ha, _tm, _op, _vn, _score, _cwd, _tmRung, _opRung, _tmFin, _opFin, _for AS '_for', _agt AS '_agt', (_for) - (_agt) AS '_mgn', IF((_for) - (_agt) > 0, 'W', IF((_for) - (_agt) = 0, 'D', 'L')) AS '_WL', ROW_NUMBER() OVER (PARTITION BY _tm ORDER BY _when DESC) as '_game', DATEDIFF(_when, LAG(_when, 1) OVER (PARTITION BY _tm ORDER BY _when)) AS '_tmDays', DATEDIFF(_when, LAG(_when, 1) OVER (PARTITION BY _op ORDER BY _when)) AS '_opDays', LAG(_vn, 1) OVER (PARTITION BY _tm ORDER BY _when) AS '_pre' FROM haven WHERE YEAR(_when) BETWEEN 2010 AND 2023),

middle AS (SELECT *,

@temp := if (_tm > _op, CONCAT(LEFT(_op, 2), LEFT(_tm, 2)), CONCAT(LEFT(_tm, 2), LEFT(_op, 2))) AS _temp,
@versus2 := IF (_HA = 'H' AND LOCATE(@temp, @versus) > 0, CONCAT(@versus2, @temp, '.'), @versus2) AS _V2,
@versus := IF (_HA = 'H' AND LOCATE(@temp, @versus) = 0, CONCAT(@versus, @temp, '.'), @versus) AS _V1,
@game := @game + 1,

ROW_NUMBER() OVER (ORDER BY _when DESC) as '_rank' FROM inside WHERE YEAR(_when) = 2023 AND _rnd < 30)

SELECT @versus, @game, CHAR_LENGTH(@versus2), CHAR_LENGTH(@versus), _tm AS 'Team', count(*) AS 'P', SUM(IF(_for > _agt, 1, 0)) AS 'W', SUM(IF(_for = _agt, 1, 0)) AS 'L', SUM(IF(_for = _agt, 1, 0)) AS 'D', SUM(_for) as 'For_.0', SUM(_agt) as 'Agt', SUM(IF(_for > _agt, 4 / IF(LOCATE(_temp, @versus2) > 0, 2, 1), IF(_for = _agt, 2 / IF(LOCATE(_temp, @versus2) > 0, 2, 1), 0))) AS 'Pts', 100 * SUM(_for) / SUM(_agt) AS '%_.1%' FROM middle WHERE 1 GROUP BY _tm ORDER BY SUM(IF(_for > _agt, 40, IF(_for = _agt, 20, 0))) + (SUM(_for) / SUM(_agt)) DESC

 "Custom Crunches"  Tue Oct 10th, 2023.
Resurrecting the Android scripts into PHP and JS. You can try it out from the menu on the left.

Very much a work in progress.

 "Utopia"  Fri Oct 6th, 2023.
I've resurrected the "Utopia" Crunch.

Imagine a perfect season - where each team plays each other twice, home and away.

This crunch goes back to find the last time each team played each other. Even back to 2017 for the last time the Eagles played the Lions at home.

You can find the ladder in the new 'Crunch' section (menu to the left).

 "Progress"  Wed Oct 4th, 2023.
The Magpies and the Lions are now the 'yard sticks' of the competition.

So how does everyone else hold up?

Try:
#TeamPWLDForAgtPts%
1Haw541048540816119
2Bul532038937912103
3Swa5230390431890
4Tig5230423486887
5Dem5230385411894
6Cat52304554198109
7Eag5140296540455
8Blu5140361415487
9Cro51404124094101
10Pow5140430503485
11Sun5140357459478
12Bom5140329448473
13Doc5140366469478
14Sai5050303385079
15Kan5050321569056
16Gia5050335473071
  5.01.43.60.0377.3450.35.585.3
 

Well, it seems the Hawks are doing quite well!

 "First Steps"  Tue Oct 3rd, 2023.
Time to try our first "crunch" using the new database.

The tables are fully scripted! You can sort the columns by clicking on the column header (click a second time to reverse the sort). Hovering over the column name should give you a descriptor and/or and average value for that column. And clicking the team name should open up a second table with more detailed breakdown of the last 25 games involved.

2023 Home and Away Season:
#TmPWDLFAPts%Days
1Mag2318052,1421,68772127267
2Lio2317062,1801,77168123266
3Pow2317062,1491,90668113265
4Dem2316072,0791,66064125265
5Blu2313191,9221,69754113265
6Sai23130101,7751,64752108266
7Gia23130102,0181,88552107265
8Swa23121102,0501,86350110265
9Bul23120111,9191,76648109266
10Cro23110122,1931,87744117266
11Bom23110121,8382,0504490267
12Cat23101122,0881,85542113266
13Tig23101121,8561,9834294265
14Doc23100131,8351,8984097266
15Sun2390141,8392,0063692266
16Haw2370161,6862,1012880266
17Kan2330201,6572,3181272266
18Eag2330201,4182,6741253266
  23.011.40.211.4  46.0102.3265.8
 
 "We're back"  Sun Oct 1st, 2023.
After a bit of a (mainly COVID related) hiatus.
- We've just had a change in hosting services (VentraIP).
- I've taken the opportunity to rebuild the site from scratch!
- A simplified structure for the database of game results.
- Migrating from MySQL 5 to MariaDB 10 (steep learning curve).