Thanks for trying to help. Maybe i'm way over complicating this. I have a 1 or 0 indicator but the indicator can be both 1 and 0 for a given dim. For example in the attached qvf for dim = c and dim = f the indicator is both 1 and 0. I want to count the dim when it's only 1. I want to count the dim when it's only 0. And I want the dim when it's 1 and 0. So my expression is calculating correctly but the dimension isn't associating correctly. Here's the final result I'd like to get.