Walgreens Boots Alliance (WBA 3.69%) reported its fiscal second-quarter earnings last month for the period that ended on Feb. 28. And while the company soundly beat expectations for earnings and revenue, the stock still continued to slide in the days afterward. Concerns about slowing pandemic demand has led to a 6% dip in the stock's price, which is now just a couple of dollars away from its 52-week low of $42.90.

However, with the dip in price, Walgreens is a better buy than it was before. The company's fundamentals remain solid, and there are plenty of reasons to buy and hold the healthcare stock for the long term.

Pharmacist helping a customer.

Image source: Getty Images.

Its business has been remarkably consistent

Walgreens has always been a popular place for its customers to visit. It has been a trusted neighborhood pharmacy -- and while it may seem like the business itself is volatile and dependent on vaccinations of late to drive traffic, the reality is that over the years it has been incredibly stable both in terms of margins and overall revenue:

WBA Revenue (Quarterly) Chart

WBA Revenue (Quarterly) data by YCharts

The stock provides investors with great value

There is no doubt that Walgreen has benefited from increased foot traffic at its stores due to vaccinations. In total, it has administered just under 63 million COVID-19 vaccines since the start of the pandemic. And there is a legitimate concern that there could be some drop in revenue as the need for vaccines diminishes and the economy returns to normal.

However, with the stock down 18% in the past year (the S&P 500 is up 7% during that time), those headwinds are arguably already factored into the stock's current valuation. And on a forward price-to-earnings basis, it's an incredibly cheap buy when compared to rival CVS Health, which also administers COVID-19 vaccines.

WBA PE Ratio (Forward) Chart

WBA PE Ratio (Forward) data by YCharts

At a modest multiple, this can offset some of the risk for investors who consider Walgreens today. 

Its health segment is just getting warmed up

One of the promising investments Walgreens is making is in its health business. The company is in the very early innings of what could be a strong segment of its operations in the future. At $527 million in revenue last quarter, Walgreens Health is still a small fraction of the company's business today. But from the previous quarter, sales are already 10 times higher.

Data source: Company filings. Chart by author.

The company has been partnering with VillageMD, a primary-care business, to launch doctor's offices at hundreds of Walgreens locations across the country. Last year, it announced a $5.2 billion investment into VillageMD, making Walgreens the majority owner of the company. However, management cautioned on the earnings call that it could take two years for a doctor's office to scale and get to "a reasonable level of operations."

For investors willing to remain patient, this could be an attractive growth opportunity for the business. While Walgreens may lose foot traffic related to COVID-19, it could make up for that in the long term with more visits due to trips to the doctor's office.

Is the stock a buy?

Walgreens has been a stable investment over the years and consumers have always had one reason or another to visit its pharmacies. By expanding into primary care, there will be even more reasons to do so in the future. And so while there are short-term concerns about the level of store traffic, that's not something that should worry investors over the long haul. With solid, consistent fundamentals plus a high dividend yield of 4.2% (three times the size of the S&P 500 average of around 1.4%), this can be a safe buy-and-hold investment to hang on to for the long haul.