Sales in Amazon's online business fell 4% in the second quarter ended June 30, 2022 from last year’s second period. Online revenue was $50.8 billion in the most recent quarter, and analysts attributed the decline to more people shopping in physical stores as well as an overall cutback in consumer spending. The online segment was the only Amazon business that had a decline in the quarter, with its cloud service operation, AWS, having the strongest quarter with revenue jumping 33% to $19.7 billion.

Overall, total revenue at Amazon increased 7% to $121.2 billion, an increase that was faster than analysts had expected. Excluding the $3.6 billion unfavorable impact from changes in foreign exchange rates, sales increased 10% compared with second quarter 2021. Despite the rise in sales, operating income decreased, to $3.3 billion, in the second quarter from $7.7 billion a year ago.

Controlling costs has been a priority for CEO Andy Jassy, and in a statement he said that despite “inflationary pressures in fuel, energy, and transportation costs, we’re making progress on the more controllable costs.” One area of focus has been slowing the opening of new warehouses; to accommodate demand during the pandemic, Amazon embarked on an aggressive warehouse expansion program.

Amazon executives said overall business had picked up in June, and for the third quarter the company said it expects sales to increase 13% to 17% over last year’s third quarter. Earnings, however, are expected to fall from $4.9 billion last year to between break even to operating income of $3.5 billion in the current quarter.