setupTransformData function

Transform raw data as required.