Filter and re-arrange data based on multiple conditions

Thanks a lot harish. It works for me. :slightly_smiling_face: