Walgreens Boots Alliance (WBA 0.87%) is a top pharmacy retailer. Customers can shop there, pick up prescriptions -- and soon will also be able to see a doctor, with the company investing billions to launch primary-care clinics at its stores. 

Is this a recipe for success, and can Walgreens be an investment that makes you a millionaire? Or is this struggling stock likely to fall lower in the years ahead?

Walgreens stock has been crashing for years

One of the reasons it might be difficult to be bullish on Walgreens' future is that the business is an underperformer. Its profit margins aren't all that great and normally produce just a few percentage points of growth. And in recent years, the top line has been fairly stagnant:

WBA Revenue (Annual) Chart

WBA revenue (annual). Data by YCharts.

Other than paying an attractive dividend yield of 6.1% -- more than three times the S&P 500 average of 1.8% -- there hasn't been a compelling reason to invest in the healthcare stock. And that's why over the course of the past decade, its stock price is down 9% while the S&P 500 has soared more than 160%.

Can Walgreens turn its fortunes around?

Walgreens saw a boost in traffic and revenue during the pandemic, administering millions of vaccinations at its locations. But that's not a growth catalyst investors can rely on.

What could improve the outlook for the business is if its $5.2 billion investment in primary-care practices while working with VillageMD pays off. The companies have an ambitious goal of launching 1,000 clinics by 2027 in more than 30 markets. With an aging demographic creating a growing need for healthcare, it's a move that could inject some much-needed growth into the drugstore's business.

Another plus is that the company consistently generated free cash flow in each of the past three years. In the trailing 12 months, it accumulated more than $3.4 billion in free cash. This is important to ensure that Walgreens has the financial flexibility to invest in growth and find ways to expand.

Rival CVS Health demonstrates what opportunities could be out there. CVS acquired health insurer Aetna in 2018 and last month announced plans to buy home health company Signify Health. The company is reportedly looking at yet another acquisition, value-based care provider Cano Health.

Will investing in Walgreens make you a millionaire?

If your goal is to become a millionaire some years from now and retire comfortably, it's unlikely Walgreens will be the stock to make that a reality. The company could be a turnaround play, and it does offer some good value, trading at only five times its earnings. However, the stock comes with considerable risk. Its margins aren't high, and with Walmart and big tech companies showing more of an interest in healthcare of late, the future could be even tougher.

In the short term, the stock could be a good buy at its reduced valuation to secure a high dividend yield. But this is not a safe-enough investment that you can just buy it and forget about it.

Until and unless the company can demonstrate that its pivot into primary care is going to be a big win, investors are better off simply going with an S&P 500 exchange-traded fund, which is likely to be more stable than Walgreens in the long run.