Wal-Mart (WMT 0.62%) is rapidly building its e-commerce business after lagging behind Amazon.com (AMZN 1.16%) for years. In the last fiscal year, Wal-Mart increased its online sales by 30% to $10 billion. Amazon's online sales grew at a slower but still healthy pace of 20%.

The disparity remains in the amounts of online sales generated by each company. Wal-Mart's $10 billion in online sales still lags far behind Amazon's nearly $70 billion, but the higher pace of growth is significant and should be taken seriously by Amazon. In Wal-Mart's just-reported first quarter of fiscal 2015, the retailer's online sales jumped 27% -- which shows that its e-commerce presence is picking up steam. Amazon's sales also increased in its recently reported first quarter by 23%, but that percentage increase includes not only retail sales but service sales as well, such as its cloud and media offerings.

Which company is a better buy?

 

P/E

Forward P/E

PEG (5-year)

P/CF

Wal-Mart

16

14

2

11

Amazon

464

89

6

27

Data Source: Yahoo Finance and Morningstar

Amazon has an astronomical P/E on a trailing-twelve-month basis at 464, which is twenty-nine times the P/E of Wal-Mart on that same basis. So Amazon's earnings are twenty-nine times more expensive than those of Wal-Mart. In order to justify Amazon's valuation based on these metrics, an investor really has to believe that Amazon's growth and profitability will not only exceed Wal-Mart's going forward but really outperform most other companies in the broader market as well. Not too many companies carry P/E ratios of 400-plus.

Looking forward, the disparity between Amazon's and Wal-Mart's P/E ratios is not as grand but is still significant. Amazon's forward P/E of 89 is over six times more than Wal-Mart's at 14, but it is important to remember that these values consider projections for the next twelve months. The PEG ratios of the two companies also consider future projections, but they cover a five-year period. A PEG of over one shows overvaluation and Wal-Mart's ratio puts it in that territory. Amazon's PEG exceeds that of Wal-Mart, however, and is pricey at a value of six, three times more than Wal-Mart's PEG. Therefore, both companies have a lot of growing to do and earnings to generate over the next five years to grow into their valuations based on their five-year PEG ratios -- but Amazon has the most to do.

Investors also have to pay almost three times the price for Amazon's cash flow than they do for that of Wal-Mart as the companies have price-to-cash flow multiples of 27 and 11, respectively. Cash flow is important to all companies, but it is especially so for retailers like Wal-Mart and Amazon that have to maintain their capital bases in the form of stores and/or distribution centers.

The e-commerce wars heat up

Source: www.geekalerts.com

Alibaba's IPO will give it cash to expand, perhaps within the United States in addition to its domestic market in China. Alibaba could pose a threat to both Wal-Mart and Amazon if it forays into the U.S. market, but Amazon has the most to lose because it is solely Internet-focused like Alibaba. Wal-Mart is growing its presence online, however, and has a considerable brick-and-mortar presence in China.

Foolish takeaway
Amazon has to maintain its dominant position in e-commerce if it wants to maintain its lofty valuation. Wal-Mart has an easier road ahead considering Alibaba's business model and has an opportunity to not only grow but take market share from Amazon as well. The e-commerce wars are just heating up and all of the players involved will have to hunker down and execute flawlessly to keep shoppers coming back to their sites.