Unanswered: Excluding from results based on criteria - how to?
I have an issue whereby I need to measure the number of people who had membership at any one time. So in the scenario, I need to know how many people have a full membership at a point in time (dotted line). In this instance, I want to ensure that Person B is only counted once instead of twice however the only way I can think of doing it is counting the number of start dates with no end date at a point in time. This however currently gives me a result of 3 instead of 2. How can I avoid Person B being counted?
Does this make sense? Whats the best way in Postgres to calculate this?