Costco (COST  ) shares were higher by nearly 10% following the retailer's Q1 earnings results which exceeded analysts' estimates on the top line and were in line with expectations on the bottom line. Investors were closely watching the report to see how it was dealing with higher costs due to inflation and excess inventories which resulted in big declines for competitors like Walmart (WMT  ) and Target (TGT  ).

It also caused sympathy selling in Costco which went from an all-time high in late April to fall by more than 30%. It's a change in fortune for Costco which has been a huge winner during the pandemic, and this momentum continued in 2021 due to stimulus payments and increased spending on goods vs services. Now, it's seeing the other side of this 'bullwhip' effect as spending on goods declines just as retailers were stock higher than average inventories due to strong demand and supply chain issues.

Inside the Numbers

In Q1, Costco reported $3.04 per share in earnings which were in line with analysts' estimates and an 11% increase from last year. Revenue topped expectations at $52 billion vs $51.6 billion. This was a 15% increase from last year's fiscal Q3 revenues of $45.3 billion.

So far, the company is on track to exceed its full-year forecast of $223.4 billion in revenue. However, the company did miss estimates in terms of same-store sales growth of 10.8% vs expectations of 11.8%. E-commerce sales grew by 7.9%.

While, Costco's growth looks impressive, especially on the top line, one mitigating factor is that gasoline accounted for a huge component of the growth. Additionally, people's spending on food and other staples is increasing as consumers buy bulk to stretch their dollars. And, they are spending less on high-margin items like electronics, appliances, and furniture. Thus, there is downward pressure on margins for retailers. Costco's margins compressed by about 1% in the quarter.

Investors face the daunting challenge of unwinding whether this is more of a pandemic-induced factor due to heavy spending on these items for the last 2 years or is this a precursor of more economic weakness.

One upside to Costco is that it has a membership model which makes it more immune to economic fluctuations. Further, the company owns its own supply chain to an impressive degree for a retailer which also makes it more resilient during adverse periods.