It was on Dec. 31, 2014, when Walgreens Boots Alliance (WBA -1.18%) officially formed, following Walgreens' merger with Alliance Boots. The merger would result in "the world's first global pharmacy-led, health and wellbeing enterprise," giving Walgreens a big presence in Europe. But would investing in 2015, after that deal had taken place, have paid off for investors? Here's a look at how the business has performed -- and if it's a good buy today.

The stock began trading at $76

On Jan. 2, 2015, shares of Walgreens Boots Alliance closed at a price of $76. While it did initially rise in value, the stock has been on a persistent decline for much of the past eight years. Today, it's trading at around $35, and investors buying the stock after the merger would have lost more than half their investment. A $25,000 investment in the business back then would be worth just $11,600 right now.

There is, of course, the stock's high-yielding dividend. If you include that and assume that those payouts were reinvested back into your investment, then those holdings would now be worth over $14,900, for a total decline of 40%.  Either way you slice it, the healthcare stock has made for a brutal investment since the Alliance Boots merger.

How the business has performed

The problem with Walgreens' business can be summed up in just a single chart:

Chart showing Walgreens Boots Alliance's revenue rising slightly and operating income falling since 2019.

WBA Revenue (Annual) data by YCharts

The pharmacy retail business isn't a big growth business to be in. That could explain why rival CVS Health has opted to seek out multiple acquisitions over the years to diversify its operations. Walgreens hasn't, and while it has generated growth, sales haven't exactly been skyrocketing for the company.

Another problem is that margins aren't great. While it looks like the company's bottom line has tanked significantly in recent years, it's really a margin problem. Since 2016, Walgreens' gross profit margin has fallen from 25.5% to 21.3%, meaning that the cost of goods sold now eats up nearly 80 cents of every dollar of revenue that the company brings in. There's little left over to cover overhead and other expenses, and so any increase in those costs can have a disastrous effect on the company's bottom line.

Here's a quick overview, comparing fiscal 2016 (when the company did well) versus fiscal 2022. Walgreens' year ends in August:

Item 2022 2016 Percent Change
Sales $132,703 $117,351 13.1%
Cost of Sales $104,437 $87,477 19.4%
Gross Margin 21.3% 25.5%  
Selling, General, and Administrative Expenses $27,295 $23,910 14.2%
Operating Income $1,387 $6,001 -76.9%

Data source: Company filings. Figures in millions.

As you can see, even despite growing revenue, Walgreens' gross profit actually worsened over the years as its margins deteriorated. Meanwhile, its selling, general, and administrative expenses rose by 14%, and that was enough to wipe out most of the company's operating income. 

Is Walgreens a better buy today?

Walgreens has sold off the majority of its Alliance Healthcare business (a European pharmaceutical wholesaler) it acquired in the merger from 2014. It has even contemplated selling off Boots (a U.K.-based pharmacy chain and beauty retailer) as well although it has held on to that business, at least for now. The company is now pivoting toward primary care, investing billions in VillageMD to launch clinics at Walgreens locations.

It's a risky move for a company that doesn't have strong financials. But Walgreens does need to do something to turn things around, and banking on its trusted name and using that to help draw customers in to primary care clinics could be what ends up making the stock a good buy.

While there's potential here, investors may want to take a wait-and-see approach before buying shares of Walgreens to ensure that it is on the right path. This isn't a stock I'd feel too comfortable with given its track record. And even though its dividend yield of 5.4% is attractive, there's risk there as well. Unless you have a high risk tolerance, you're better off keeping this stock on your watchlist rather than in your portfolio.