The drawdown in Walmart ‘s stock on the back of a disappointing profit warning creates an outstanding opportunity to buy shares of the retail giant, according to some analysts. Walmart on Monday slashed its profit expectations for the second quarter and full year as it grapples with rising inflation and a shift in consumer spending, in a move that sent shares of the retailer plunging more than 8%. To be sure, many analysts believe the findings spell trouble for Walmart and other retailers going forward. That said, shares are undervalued at these levels, according to UBS’ Michael Lasser, who rates Walmart a buy with a $152 price target. Stifel analyst Mark Astrachan (hold, $145) similarly believes that the stock reaction Tuesday could create a possible “clearing event” for Walmart. He said he expects the second quarter will be a “trough” for gross margins going forward, but maintained a hold rating on the stock. Despite the near-term trouble, BMO Capital Markets’ Kelly Bania (outperform, $160) expects Walmart to bounce back and produce “more consistent earnings growth cadence” going forward. “While this announcement was disappointing and highlights just how low visibility remains across the consumer landscape, we continue to see WMT’s share price as attractive for a global retailer with difficult-to-replicate scale and best-in-class price positioning,” wrote Bania of the guidance cut. Jefferies’ Stephanie Wissink (buy, $150) regarded the adjustment as a “necessary hard reset” and retained a buy rating on the stock. “While we don’t love a guide down from a company we believe is advantaged into a recession, we see this revision as more realistic vs. the prior,” Wissink wrote. Despite the profit warning, several analysts believe Walmart remains better positioned than its peers in the current economic environment. According to Goldman Sachs’ Kate McShane (buy, $135), many of the current cost pressures are probably only temporary and the company’s longer-term trajectory should prevail. Meanwhile, Walmart continues to gain market share in the grocery segment, which indicates consumers are relying on the company in this tough landscape, said Baird’s Peter Benedict (outperform, $140). The latest move may indicate a push to “clear the decks” and de-risk Walmart’s stock on the back of John David Rainey’s start as chief financial officer, he said. “We nonetheless maintain our Buy rating as we believe estimates have been de-risked and WMT seems to be picking up market share in the current environment which should prove sticky,” said DA Davidson’s Michael Baker (PT $148) in a note to clients. “This should lead to better sales while margins recover in 2023 once inventories are rightsized.” — CNBC’s Michael Bloom contributed reporting.