Preparing data for analytics