Image source: Wal-Mart Stores.

Wal-Mart Stores (NYSE:WMT) reported fiscal 2017 second-quarter results on Aug. 18. The retail giant saw its e-commerce sales growth rate accelerate, and the company boosted its profit outlook for the year ahead.

Wal-Mart Stores results: The raw numbers

Metric 

Q2 2017

Q2 2016

Growth (YOY)

Revenue

$120.854 billion

$120.229 billion

0.5%

Net Income

$3.773 billion

$3.475 billion

8.6%

Earnings Per Share

$1.21

$1.08

12%

Data source: Wal-Mart Stores' Q2 2017 earnings press release. YOY = year over year.

What happened with Wal-Mart Stores this quarter?

Total revenue rose less than 1% to $121 billion, and 2.8% on a constant currency basis. U.S. comparable-store sales edged up 1.6% -- making Q2 2017 Wal-Mart's eighth consecutive quarter of positive comps -- as traffic increased 1.2%. The performance of Wal-Mart's smaller-format Neighborhood Market stores was again a source of strength, with comps increasing 6.5%.

These rising comps helped fuel a 3.1% year-over-year increase in Wal-Mart's U.S. sales to $76.2 billion. However, sales at Sam's Club fell, decreasing 1.3% to $14.5 billion. Wal-Mart's international sales also declined, falling 6.6% to $28.6 billion, as foreign currency fluctuations once again dampened results. Excluding the negative impact of these foreign exchange rate movements, Wal-Mart's international sales rose 2.2% to $31.3 billion.

Importantly, global e-commerce sales increased 11.8% on a constant-currency basis, as Wal-Mart continues to invest heavily in this area, including its recent $3 billion deal for Jet.com.

"We remain focused on building e-commerce capabilities globally and executing our omni-channel plan, as evidenced by our recent alliance with JD.com in China and agreement to acquire Jet.com in the U.S.," said CEO Doug McMillon in a press release. "Walmart is uniquely positioned to provide customers with a seamless shopping experience where we save them time and money."

Yet this growth has come at a cost. Wal-Mart's e-commerce investments -- along with its decision to boost wages for many of its employees in order to improve morale and, by extension, customer service -- have taken a toll on profits. First-quarter operating income -- adjusted to exclude a one-time gain related to an asset sale -- fell 7.2% to $5.6 billion.

Despite the lower profits, Wal-Mart's cash generation remains strong, with the retail giant producing nearly $15 billion in operating cash flow and more than $10 billion in free cash flow in the first half of fiscal 2017. That allowed Wal-Mart to return nearly $3.7 billion to shareholders via dividends and share repurchases during the second quarter.

Looking forward

In the third quarter, Wal-Mart expects comparable-store sales growth of 1% to 1.5% for its U.S. locations, while Sam's Club comps are forecasted to be "slightly positive" when excluding the effects of fuel sales. The company also anticipates third-quarter earnings per share will be between $0.90 and $1.00.

Additionally, Wal-Mart raised its fiscal 2017 full-year adjusted EPS forecast to $4.15 to $4.35, up from its prior guidance of $4.00 to $4.30.

"I'm pleased with the momentum in the business," added McMillon. "We have a plan, and we are executing against it and customers are responding favorably."