Target (TGT -0.72%) missed the mark in its mid-August earnings report. The retailer announced surprisingly weak sales for the second quarter and reduced its revenue outlook for 2023 thanks to soft demand in a few big areas.

There were some bright spots in the report, to be sure. And Target isn't the only company that is seeing sluggish demand for consumer discretionary products right now.

But the latest operating trends raised big questions for investors about the stock's value. Let's look at whether shares are attractive right now.

A difficult sales environment

There is no doubt that Target is facing an unusually tough operating environment today. Its merchandise offering tilts toward nonessentials like home furnishings, an area that consumers are avoiding these days. That fact sets it apart from chains that deal more in staple products, including Walmart and Costco.

The difference showed up in the core comparable-store sales (comps) metric, which was down 5% in the period. Walmart's U.S. business grew by 7% this past quarter, in contrast. Target executives said rising demand in staple products like groceries wasn't enough to offset big drops in other categories.

Making the best of a bad situation

There was much better news on the earnings front. Gross profit margin improved to 27% of sales from 22% of sales a year ago, reflecting less need for markdowns. That win was partly thanks to the company's efforts at reducing inventory over the last year.

Successes here lifted the operating margin, too, which rose to 5% compared to 1% a year ago. Sure, that's still below the 6% rate that Target enjoyed before the pandemic (and well below its peak of 8% when demand was soaring). But it was a step in the right direction, as the chart below showing trailing 12-month figures shows.

TGT Operating Margin (TTM) Chart

TGT Operating Margin (TTM) data by YCharts; TTM = trailing 12 months.

"We saw better-than-expected profitability in the face of softer-than-expected sales," CEO Brian Cornell said in a press release. Net earnings jumped to $835 million, or $1.81 per share, from $183 million, or $0.40 per share, a year earlier.

Looking ahead

Target is less confident about its 2023 sales forecast and has updated its outlook to include the potential for bigger comps declines this year. At the same time, its low inventory position and rising profit margin put it in a great position to boost earnings this year and to see much bigger gains once the current spending slump ends.

Given that good news, it would be an overreaction to abandon the stock here. The retailer's shares are priced at a big discount already, after all. Target stock is valued at 22 times earnings, for example, while Walmart's price-to-earnings ratio is closer to 38. Target's price-to-sales ratio is 0.5, too, compared to Walmart's 0.7.

Yes, the next few quarters could show sluggish sales trends that reflect weak demand for some key product lines. But Target will likely be setting new annual earnings records before long, and its revenue base will rebound at some point, too. Patient investors should hold on through this volatility and wait for the inevitable recovery.