We don’t have to tell you to that coming up with a valuation for your company is a hard thing to do, relying on equal parts art and science.

Factors that must be considered include cash flow and cash expenditures on improving and growing operations, assets, earnings potential and goodwill, which is that amorphous attribute that’s synonymous with a company’s reputation. But sometimes valuations can run far ahead of reality, and that could present you with a quandary.

Those points were brought home by online retailer Amazon, which surprised analysts this week by posting $92 million in profit for the second quarter, which it doesn’t often do. The announcement was enough to send the e-commerce retailer’s shares up 10 percent Friday, which in turn pushed its valuation up to $247 billion. That surpasses Walmart’s own valuation of $231 billion, even though Amazon’s total net sales of $88 billion for 2014 are a fraction of Walmart’s nearly $500 billion in sales for the its fiscal 2014. So what gives?

Finance and valuation experts say Amazon’s increasing valuation is as much based on potential for sales as anything else, while Walmart is facing realities as an older, more mature company facing potentially lackluster sales from the markets it has long dominated.

“Valuations are in part predicated on future results and expectations of good future results,” says Mitchell D. Weiss, an adjunct finance professor at the?? University of Hartford.

So by giving analysts, who had expected a loss from the company in the second quarter, an unexpected profit, Amazon has perhaps inadvertently set an expectation for more profits in subsequent quarters.

Weiss adds that Amazon, which has always been an online retailer, represents the overall direction of the retail market, which revolves around the Internet and, increasingly, mobile transactions.

“There’s a whole question [as] to what extent the big box stores will become things of the past, if they are nothing more than showrooms,” Weiss says.

Certainly, Walmart has seen the future too, and has set up its own online store, including a product offering that competes with Amazon’s Prime service, which gives purchasers access to special deals and faster delivery times, as well as free shipping in exchange for an annual fee.

But it’s got a massive infrastructure of stores, warehouses, and products to maintain and manage, says Bruce Bingham, managing director of the strategic advisory Berkeley Research Group, and a valuation expert. By contrast, Amazon has shifted to a model where it doesn’t necessarily even own the products its selling, so it can probably forecast higher growth than its bricks and mortar competitor, which also factors into valuation.

(Spokespeople from Amazon and Walmart were unable to comment by deadline.)

“Their projections are sort of immune to many of the characteristics and harsh realities that bricks and mortar stores and other corporations have to be able to face,” Bingham says.

At the same time, financial experts say, there are outsized expectations in the tech market, which some theorize is approaching bubble territory. So, while no one is expecting Amazon’s valuation to come crashing back to earth any time soon, it may not continue going up forever.

“We don’t really know the capacity of e-commerce, and whether its technical, web-based capacity is infinite or finite,” Bingham says.