3 May 2026 · 5 min read
Post #1Walmart has a weird fiscal year. And it broke my data.
Why some companies don't follow the calendar, and what that meant for my system. A small accounting quirk that cost me three days of rework.
Most companies close their books on December 31. Logical, since that lines up with the calendar year. Annual reports come out in January or February, shareholders are pleased, the next year starts.
Walmart does it differently. Walmart's fiscal year ends January 31. Their "fiscal year 2024" ran from February 2023 through end of January 2024. Their Q4 numbers don't come out in February. They come out in May.
Costco does it differently too. Apple does. Microsoft closes on June 30. A few hundred companies use a "fiscal year" that doesn't match the calendar.
For you as an investor, that doesn't matter. For me as a builder of a trading system, it mattered a lot. So much so that it broke a week's worth of work.
What happened
My system fetches fundamental data each evening for around 550 stocks. Revenue, profit, debt, cash flow. For each company I want to know: what are the most recent numbers, when were they published, and how do they compare to prior periods.
To determine "prior periods," my system uses the calendar year. Q1 is January to March, Q2 is April to June, and so on. For most companies that works. Their fiscal Q1 lines up with calendar Q1.
For Walmart it doesn't. Walmart's "fiscal Q1 2024" ran from February to April 2023. Their "fiscal Q4 2024" ran from November 2023 to January 2024. The number sitting in my database labeled "Walmart Q1 2024" was actually Walmart's data from a different timeframe than Visa's "Q1 2024."
I was comparing apples to pears, and my system didn't know it.
How I found out
At first I didn't notice. Walmart sometimes scored oddly on my factor analysis, but I dismissed it. It's a big company, it moves slowly, scores fluctuate.
Until I put the Catalyst factor into production. That factor scores high when a company has recently reported an unexpectedly good or bad result. The ratio is simple: actual EPS divided by expectation. Above 1 is positive surprise, below 1 is disappointment.
Walmart had a Catalyst score of 0.3. That would mean their EPS came in 70 percent below expectations. A disaster. Yet Walmart's share price was rising and the company had issued positive guidance.
Something didn't add up. I dug into the data and saw it: the "EPS" my system was using for the most recent quarter came from last February. Three quarters old. Compared against analyst consensus for the most recent quarter. No wonder it looked catastrophic.
Why companies do this
A fiscal year that differs from the calendar year seems arbitrary, but there are real reasons.
Walmart and Costco end their year in January because the Christmas season is their biggest selling period. If they closed in December, they would be counting inventory, processing returns, and closing books in the middle of their most important season. Awkward. By choosing end of January, the season is over and they have time to wrap things up properly.
Apple ends in late September. Their new iPhones launch in September. By closing right after, the product launches and annual reports fall in the same cycle.
Microsoft ends June 30. Software companies often have large enterprise contracts that end in June, since governments and large corporations close their annual budgets on that date. Microsoft's fiscal year follows the rhythm of their customers.
Each is a logical choice for the company. But for me, trying to compare hundreds of companies side by side, a nightmare.
The fix
Not a fun weekend. My database had a "fiscal_year" field that matched the company's own year designation. So Walmart's "fiscal year 2024" was stored as 2024 in my database, even though it ran from February 2023 to January 2024. My comparisons, which looked at the calendar year, kept missing the mark.
The solution was easy to say, hard to do. Instead of trusting each company's own year designation, I now use the actual end date of each quarter. A Walmart quarter that ended on January 31 2024 is treated by my system as a Q4 2023 quarter, regardless of what Walmart calls it themselves.
That sounds logical, but it meant I had to rebuild every link between fundamental data and my analyses. Hundreds of lines of code, hundreds of tests, a new dataset I had to fetch from source again.
Three days of work. And after all that work I didn't have more numbers, more features, or more stocks. I only had what I should have had all along: comparisons between comparable periods.
What I take from this
Sometimes the difficulty in building isn't in writing clever code, but in recognizing that the world is less simple than you thought. I had assumed every company used the same fiscal year as the calendar. That wasn't true. An assumption that seems innocent at first glance can poison a whole chain of decisions.
This is what I find more interesting about this project than I had expected. It isn't "write some code." It's "first understand how the world works, and then build something that can deal with it." Walmart has a weird fiscal year because their Christmas revenue is large. Apple has a weird fiscal year because their launch is in September. There is logic behind it, and my system has to respect that logic.
One bug fixed. Two hundred others I haven't found yet. That's what building is.