Walmart (WMT 1.02%) stock has become more attractive lately as investors move toward large, stable businesses that can perform well through a wide range of selling environments. The retailer's shares are up so far this year, compared to a slump of over 30% in major competitor Amazon's share price.

That optimism will be tested when Walmart announces its fiscal 2022 first-quarter results in just a few days. That report, set for Tuesday, May 17, will tell investors a lot about the health of consumer spending trends during the latest inflation spike. The big question is whether Walmart is still growing in this rapidly changing selling environment.

Let's take a closer look.

A Walmart worker weighs produce to packup for curbside delivery at a Walmart store

Image source: Walmart.

Sales trends will get close scrutiny

Walmart's most recent earnings report contained plenty of good news about the business. Comparable-store sales were up 6% through late 2021, with gains coming from both rising customer traffic and higher average spending.

The chain won market share in the period, partly because it secured enough merchandise, at low prices, to give it an advantage over its smaller peers. Average spending was especially strong, rising 2% on top of a 22% spike a year ago.

Yet Walmart's e-commerce segment was a drag on overall results. That niche likely will be a bigger pressure in Q1, too, considering that shoppers appear to be moving away from digital spending after two years of intense focus in that area. Amazon recently announced some of its slowest growth yet in the online business, which surprised Wall Street. The main concern is that Walmart will report similar weaknesses in the e-commerce division.

Pressure is being seen on multiple fronts

There are pressures beyond just the sales slowdown, too. Walmart likely faced soaring costs in areas like transportation and wages. It has been hard to keep employee turnover low, too, in this tight labor market. And the chain might be seeing a demand shift away from some high-margin products, like home furnishings and apparel, as consumers prioritize spending on essentials.

WMT Operating Margin (TTM) Chart

WMT Operating Margin (TTM) data by YCharts

Investors have been hoping that Walmart's profit margin will start moving back toward the highs they saw back in 2013. But that rebound might take more time, and earnings could be pressured in 2022 by the combination of slowing demand growth and rising investment spending on the business.

Looking ahead

Walmart executives could update their fiscal year outlook to reflect the latest demand and cost trends. Heading into the report, that forecast calls for sales to rise by about 3% after currency exchange swings are accounted for. Profit margins were forecast to hold steady as capital spending jumps.

A weaker selling environment might convince CEO Doug McMillon and his team to lower the earnings outlook on Tuesday. But the chain isn't likely to pull back on needed investments in its stores and the online business. Spending there lays the groundwork for faster sales growth over time.