Readying to release its 2014 second-quarter earnings, hip retailer Urban Outfitters (URBN 4.51%) has been a strong performer over the past 12 months, and, last quarter, delivered record sales and a 39% earnings bump. But, as has been confirmed by many a retailer during this earnings season, the industry climate has been cloudy at best, with very few players able to shine through. Add to that a forward valuation of nearly 18 times earnings, and you have a hard-to-sell investment thesis: a pricey stock in a difficult business. With upcoming earnings in mind, what will it take for Urban Outfitters to be a buy?

The right formula 
Using a Peter Lynch-ian approach of walking through a store and looking around, Urban Outfitters has long been an appealing pick. Urban Outfitters locations are spacious stores that are easily navigable and encourage wandering. You may have wanted to pick up a trendy graphic tee, but you end up looking at a wide array of hilarious coffee table books, or even records. It's a one-stop shop for those who have a certain image to uphold.

Since 2004, the stock has been on a near-vertical trajectory, up almost 400%, with a few dips in between. Even with its quick climb, the stock isn't abhorrently valued, at 18 times forward earnings and about two times sales. The company is substantially more richly valued than one of retail's biggest recent success stories, Gap. However, Urban Outfitters may justify its higher premium, as it not only holds growth in its core brand, but with its smaller concepts as well. The company owns home goods and clothing store Anthropologie, women's fashion retailer Free People, and Terrain, a home and garden concept.

One of Urban Outfitters' major coups is its ability to push its middle-of-the-road merchandise at relatively high prices -- across all of its store platforms. With last quarter's earnings at record numbers, it's clear that the cool factor is a premium shoppers are willing to pony up for.

Still, retail has taken a hit this quarter, leaving very few unscathed. At the higher end of valuations for this type of retailer, Urban may be at risk. So what's an investor to do?

Dip it 
If the company were to miss estimates, and fail to give investors and analysts the short-term good news they demand, the stock could be ripe to fall. If that's the case, the stock could become a buy in the mid-$30s.

Famed investor Joel Greenblatt loves retail stocks because they seem to get punished more than other sectors, and you have a constant flow of information to digest. He believes that a good retailer and merchandise picker, over the long term, is a great bet, and that short-term retailing trends don't really matter. If that's the case, investors may get a chance to pick up Urban's stock while it's on sale. As a taste-maker and trendsetter, Urban Outfitters resonates well with a young demographic, and its other brands are gaining traction with slightly older, more sophisticated, cash-laden shoppers.

Greenblatt's firm increased its position in Urban by nearly 60% back in June.

The bottom line is: An earnings miss for the company could trigger a short-term sell-off, and if it does, it just might be time to go shopping.