Walmart (NYSE:WMT) reported its fourth-quarter results Tuesday, and the TL;DR is "Happy holidays." Same-store sales were up by 4.2%, its groceries and toys segments performed well, and its e-commerce business surged at a stellar rate.

In this segment of the MarketFoolery podcast, host Mac Greer and senior analysts Ron Gross and Jason Moser discuss the retail titan's successful reorientation toward the new omnichannel reality, how it compares to Amazon (NASDAQ:AMZN), its strategies and investment thesis, and the new "weak spot" for the company.

A full transcript follows the video.

This video was recorded on Feb. 19, 2019.

Mac Greer: Let's begin with Walmart and some really impressive earnings here, Ron. Same-store sales in the U.S. up 4.2%. Groceries and toys, two of the big highlights. E-commerce sales up 43%. I had to really hit the e there because you don't really think of Walmart with e-commerce. The stock up around 3%. Some happy holidays for Walmart, huh?

Ron Gross: Yeah, really, really strong. This is 18 quarters of U.S. comparable sales growth. If you recall, five years ago or so, let's say, all we talked about is how they needed to turn the U.S. business or this was going to be a company in trouble. Kudos to them for really getting that done. Eighteen quarters later, what a streak! As you said, the numbers are great. Comp sales up 4.2% is very strong. Strength in grocery sales. Online orders, as you mentioned, e-commerce up 43%. Holiday purchases, including toys, were quite strong.

They did have a little bit of a benefit from the government shutdown. It caused the government to move up the distribution of food stamps. That actually had an impact. A small impact, but it did improve sales just a bit here. That won't happen again in the future.

Traffic was up a little bit less than 1%. That's not amazing, but it's fine. What's better is that the average shopper's ticket was up 3.3%. Those two things combined to have some nice increase in sales.

Greer: That all sounds good! Jason, what's not to like here?

Jason Moser: I mean, nothing, really. It depends on what you're looking for in an investment. If you go back five years and look at how Walmart has performed, on an absolute basis, it's returned you some money. On a comparison with the market, it's trailing the market. That's understandable. You throw Amazon in the mix there and then you can see very clearly the premium that the market's been willing to assign Amazon because of the move toward e-commerce.

But I think when it comes to Walmart, you have to look a little bit beyond the e-commerce part of the market and understand that Amazon still has that little cloud business.

Greer: I've heard of that.

Moser: It's a big tailwind for them. That's where it really differentiates itself from Walmart. A doff of the cap at Walmart for competing. I really think they're doing a wonderful job of participating in competing in this space. But that's the one thing that Amazon has that Walmart doesn't, and I think that's why you would invest in Amazon over Walmart. You've got that cloud business, it's operating on about a $30 billion run rate.

Greer: Amazon Web Services.

Moser: Some of you may have heard of it. It's generating over 30% operating margins. That's where a lot of that profitability comes from. Whereas with Walmart, that's a retail play and it's operating on a much thinner margin. But again, not taking anything away from Walmart. What Walmart has been doing has been very admirable, particularly when you look at how quickly e-commerce has reshaped the retail space.

Gross: If you're looking for weakness, you could probably point international here for Walmart. Sales were actually down 2%. If you exclude currency, it looks a little better, up almost 3%. But they've been struggling there. They've sold off their stores in Brazil recently. They merged their U.K. operations with a rival. They spent $16 billion on Flipkart. Let's see how that goes. I think we're going to see some pressure, at least in the near-term, on earnings as a result of that acquisition. But perhaps it will end up bearing fruit down the road. So international could use some firming. If they get the U.S. and the international business firing on all cylinders, if you will --

Greer: I will!

Gross: -- if that happens at the same time, then you'll see the stock be a little bit less anemic.

Greer: I want to tie those two points together. Jason was mentioning Amazon being assigned a multiple or premium in part because of Amazon Web Services and the cloud business. I think, as you look at Walmart's success, there's no question that there's going to be room for Walmart and Amazon in the near future. The question we have as investors is: Can these both be market-beating stocks? If Walmart has struggled to beat the market recently, is that going to change? Or, ultimately, does Amazon keep Walmart from being a market-beater?

Moser: I'd actually jump in here and say, perhaps the reason why Walmart has not beaten the market over the past five years is because they had to adapt quickly to a space that had changed seemingly overnight. They've made that adjustment, I think pretty well. One place where Walmart still does really well, especially when you compare it to Amazon, is in grocery. Amazon's trying to participate more in that space, obviously, with the Whole Foods acquisition. But I think Walmart still has a leg up when it comes to the grocery space, and I think they'll probably continue to have that because their offering resonates with most of the people out there in the country looking for value and convenience. With Amazon, sure, you're getting value and convenience, but Whole Foods, they're starting to push those prices back up, so they're separating themselves a little bit from the bigger market opportunity.

I would actually venture a guess that Walmart can be a market-beating investment from today because they've adapted so well to the changing space. I think they've set themselves up for success.

Gross: I think that's fair. Twenty-one times earnings, 2% dividend yield. I think it does have the potential to beat the market. Compare that to a Costco at 28 times, you're paying a premium for a company like Costco. Walmart, a little bit cheaper, and as a result, perhaps can be a market-beater.

Greer: OK, there you go. Bullish on Walmart, not quite as bullish on Costco? Is that fair?

Gross: Not at the current price, not quite.

Moser: [laughs] It always comes back to Costco.

Gross: It's a great company, and it will be a great company for the foreseeable future. The stock's not that cheap, though.

Greer: $1.50 hot dog and drink.