Macy's (M  ) didn't have a fantastic second quarter but beat analyst expectations to deliver a better quarter. The company saw opportunity ahead, stating that there was a large amount of market share up for grabs.

Looking over Macy's quarterly report, the company isn't out of the woods yet, still showing some damage from the pandemic. Macy's net sales are down $1.9 billion in Q2 compared to last year and is down $4.5 billion in the first half. The company reported losses of $431 million, compared to gains of $86 million in 2019, with a loss of $4 billion in the first half compared to gains of $223 million. Adjusted net losses were $251 million for the quarter and $881 for the first half. Losses per share were $.81 for the quarter compared to earnings of $.28 in 2019, with losses of $2.83 for the half compared to earnings of $.72.

Overall, compared to Q1, Macy's is showing improvement. Macy's beat expectations, coming out ahead of analyst expectations with sales, it's $3.6 billion in sales beating analyst expectations of $3.5 billion. The weakness was primarily in sales at physical storefronts, a result of lower mall traffic despite reopenings across the country. Macy's, however, saw the blow softened by a surge in online sales.

Compared to its contemporaries, Macy's is coming out ahead. Talking to CNBC, Macy's CEO Jeff Gennette noted that the company was doing well in luxury retail as many of its luxury rivals suffer from the pandemic.

"Look at luxury right now, look at Neiman's, look at parts of Lord & Taylor," Gennette said. "There is opportunity for us. Nordstrom is closing stores."

Overall, Gennette sees $10 billion in luxury retail market share ripe for the picking due to the struggle Macy's rivals are facing. Due to the company's better quarter and overall better status compared to competitors such as Neiman Marcus and Nordstrom (JWN  ), it's likely that Macy's will be able to snatch away at least some of its competitor's market share.