According to this answer on Meta your ranking value is determined by these factors:
Take your position, then convert that position to a percentage for all users that qualify (only users with 200 points or more and with a positive reputation change in that period are listed in the rankings).
The highest percentage is then shown on your profile, rounded up to a sensible number.
https://meta.stackoverflow.com/a/280038/3850405
There is also a nice answer on data.stackexchange.com calculating rank and percentile:
https://data.stackexchange.com/stackoverflow/query/6772/stackoverflow-rank-and-percentile
However this answer only counts users with a reputation above 100 so perhaps this was the previous requirements, the query was created in 2010.
I have edited the query to only include users with 200 points or above and I think this query gives the correct result for year rank.
The query shows me a rank of 32130
with a reputation of 4007
and on reputation league all time
my rank shows as 31895
with all time reputation of 4,042
. Current reputation is 4,047
so I guess this has something to do with update frequency. Is this a correct guess?
What I can't solve however is to calculate year rank via data.stackexchange.com. Is this possible to do? The problem as you can see is that the user object only has reputation as an integer and I can't find something else to base it on.