partitioning data based on boolean value