Please try providing a reproducible example so that there is more background to your question.
With a reproducible example, the context would be more clear and a better understanding of the problem is obtained. This helps the community to support in a better way! You may construct the example with a sample data set.