Data preparation for analytics