script for generating consolidated entity