Two big retailers. Two different directions. That's the story for Walgreens Boots Alliance (NASDAQ:WBA) and Walmart (NYSE:WMT) in 2019. Walgreens stock has slumped by 14% while Walmart's shares have soared nearly 30% year to date.

But the tide can quickly turn with investing in stocks. Which of these retailers is the better pick? Here's how Walgreens and Walmart stack up against each other.

Customer holding medicine bottle in front of shelves of other products

Image source: Getty Images.

The case for Walgreens Boots Alliance

Let's first examine why Walgreens Boots Alliance stock has underperformed this year. A big part of the problem is the company's Boots UK business, which has faced headwinds resulting from lower funding by the National Health Service. Startup costs related to implementing a new cost-management program weighed on Walgreens' fiscal 2019 fourth-quarter earnings.

But there are some reasons to be cautiously optimistic about the company's future. For one thing, the cost-management initiative should pay off. Walgreens' management expects savings of more than $1.8 billion by fiscal year 2022.

Also, Walgreens' year-over-year comparisons should be less challenging next year. The company took a hit throughout 2019 from eliminating the sale of tobacco products in its stores. It experienced lower revenue resulting from losing some networks in early 2019 as well. Those issues won't be problematic in year-over-year comps in 2020. Even though Walgreens will lose its spot in CareSource's network, the company expects to more than make up for that loss.

The company is experimenting in multiple ways to attract more customers to its stores. Walgreens and Kroger recently expanded their collaboration to form a group-buying consortium. FedEx customers can drop off and pick up packages at Walgreens stores across the U.S. Walgreens is even working with Alphabet subsidiary Wing to try out on-demand delivery of products via drones.

Walgreens shares trade at only 9.4 times expected earnings, well below its primary rivals. Analysts expect the company's earnings to grow -- albeit slowly -- over the next few years, so its valuation shouldn't deteriorate.

Perhaps the best thing about Walgreens stock right now, though, is its dividend. The company's dividend currently yields 3.2%. Walgreens ranks as a Dividend Aristocrat with 44 consecutive years of dividend increases.

The case for Walmart

Walmart's strong performance this year has been driven by its solid revenue and earnings growth. The company has delivered year-over-year revenue growth of 3% or more in five of its last six quarters. In Q3, Walmart handily beat Wall Street earnings estimates.

One key to the retail giant's success is its e-commerce strategy. Walmart offers online grocery pickup ervices in 1,400 stores. It also launched a new membership service where customers can pay $98 annually for unlimited grocery deliveries.

The company is revamping its international strategy to focus on high-growth markets where it can generate solid profits. A case in point is India, where Walmart's 2018 acquisition of Flipkart puts it in an enviable position. Walmart has been blocked by regulators from making other key international acquisitions, but expect the company to keep trying.

In the meantime, Walmart is expanding in another way back home. The company is making a concerted push into the home improvement market. It's also jumping into healthcare, recently opening its first in-store health center that provides a wider range of health services than you'll find in the clinics in its retail rivals.

Walmart stock isn't cheap, though. Shares trade at 23 times expected earnings, well above most other big retail stocks. Wall Street projects that Walmart will grow earnings by around 5% annually over the next five years, which is a good level for the company but not enough to make its valuation appear more attractive.

Like Walgreens, Walmart is a Dividend Aristocrat. Its streak of dividend increases is even more impressive, too, with 46 years in a row. Walmart's dividend currently yields nearly 1.8%. 

Better buy

Walgreens' dividend yield is higher, and its valuation is more appealing. But I still prefer Walmart. My view is that Walmart has more pathways to growth than Walgreens has. I also think Walmart's management has done a better job of positioning the company to compete in a rapidly changing retail environment.

However, I'm not a huge fan of either of these stocks. There are too many other stocks that offer better dividend yields and stronger growth prospects than either Walgreens or Walmart.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.