For years, Walmart seemed to understand exactly what its customers wanted. It developed complicated consumer analytics and used that data, along with relentless pressure on suppliers, to become a retail powerhouse that sold practically everything at the lowest possible prices.