Code for consolidate data