Walgreens Boots Alliance (WBA 1.81%) has been a brutal investment for the past nine years. Shares are down more than 75% from the all-time high, reached way back in early 2015. The one saving grace for investors during much of this period was the company's dividend, which the Board was still steadily increasing every year. From 2014 through late 2023, the payout was increased 40%.

Well, even that's gone, with the near-halving of the dividend late last year now resulting in a payout that's 26% lower than it was in 2015.

The good news is a new CEO is taking steps to slash costs and stimulate profitable growth. Is Walgreens stock a buy now? Keep reading for the one reason why it could be compelling, a major yellow flag that says maybe it's not, plus a stock that you may want to consider instead.

Reason to buy: A CEO who's accelerating the turnaround

Tim Wentworth was named CEO last Oct. 11, and he didn't waste any time in enacting cost-cutting efforts at the company. When it reported first quarter results 12 weeks later, one of the first lines in the press release announced the 48% dividend cut.

This move made a bold statement that there would be no sacred cows in this turnaround. Prior to the cut, Walgreens had increased its dividend every year for a remarkable 47 years. Wentworth -- with the backing of the Board of Directors, which has the final say on things like dividends -- has quickly taken action to get Walgreens' financial house in order so that it can enact the meaningful changes that it will take to reinvigorate the business and return it to profitable growth.

In addition to the dividend cut, the company has also taken some real steps to lower costs and expenses. The company says it will cut $1 billion in spending versus 2023, through both lower capital expenditures and working capital improvements.

Reason to sell: The math is still a mess

Wentworth is acting quickly, and with Board backing. His experience in the healthcare industry is a real plus. But the reality is, Walgreens' fast moves are as much a product of need as much a desire to improve the business.

Despite the improvements on the top line -- revenue was up 8% in the first half of the fiscal year -- non-pharmacy retail sales declined 5.3%. Management says that seasonality played some role in this, but they also lowered profit expectations for the full year, citing the competitive environment. I think those two things are more related than just seasonality.

At the same time, one of the company's biggest initiatives, healthcare, took another step backwards. Walgreens took a $5.8 billion impairment to its investment in VillageMD, reflecting much lower expectations for its full value over time. The upshot is that VillageMD revenues increased 20% last quarter, but the healthcare business continues to generate an operating loss.

This adds to Walgreens' cash flow woes. The company has burned $918 million in operating cash through the first half of the year, and spent $858 million on capital expenditures. That's a lot of money that has to come off the balance sheet to cover those checks.

Even with promised expense and cost cuts, Walgreens has a lot of work to do. In the first six months of the fiscal year, its working capital has remained unchanged, but it has burned through some $11 billion in total assets on its balance sheet.

About half of that is the VillageMD impairment, but what is easy to miss is that it has realized $1.7 billion in proceeds from the sale of its equity stake in Cencora so far this year, but Cencora's market value has increased enough to offset the impact of these sales on the balance sheet.

And as measured by cash in and cash out, as generated by its operations, Walgreens is a long way from turnaround complete. That's particularly notable for income investors who may think the "new" dividend is safe. Barring a reversal in those cash flows, another cut is surely on the table.

A better stock to buy instead

Whether you're looking for steady income, a high yield, or a likely market-beater over the long term, Realty Income (O 1.12%) may be a better choice. As a starting point, its dividend is very secure, protected by strong cash flows from its tenants that rely on the properties they lease from Realty Income to generate their sales and profits.

Realty Income is one of the largest net lease REITs -- it owns the real estate, while its tenants pay it rent, cover property taxes, and pay for improvements and maintenance -- in the world. Its tenants include Walgreens and competitor CVS Health, along with hundreds of other tenants in retailing, restaurants, experiential, and other e-commerce and macroeconomic resilient businesses.

One of the best capital allocators in real estate, Realty Income's business is built on creating value for its tenants and its investors, and growing the payout is a key tenet of its business model. It has increased its dividend not just every year since its 1994 IPO, but every quarter. It's also a monthly payer, a nice bonus for income investors.

Put it all together, and you have a stronger business, a safer dividend, and a payout that's still growing. Did we mention the yield of 5.7% at recent prices is also better than Walgreens' 4.6% yield? There's that, too.