Set analysis should work well for this, but it requires your data to be set up a certain way during the load. I am guessing you have other tables, not just the one you describe. If your set analysis tries to compare a field in one table to a field in another table, it won't work. Also, set analysis syntax is very precise; one error, and the whole thing is toast.
What set analysis have you tried so far?
So far I have done simple set analysis just limiting calculations or unions of fields. I knew these date calculations would be a lot more complex but didn't know where to start.
I've tried if statements with, around, or inside the set analysis but with little luck.
My period end and open close dates are in different tables. I'll look into fixing that.
So you can only tie one date to a "Date" filter, in your case either Open Date or Close Date, but what you really want is a status as of Date, either Opened or Closed.
You can use IntervalMatch to create a record for each day in your load script and set whether it is Open or Closed on this day. They use the newly created Status Date to filter and perform your calculations. Creating it by day rather than month end is easier IMHO and allows for more flexibility (week, month, quarter, etc).
Check out the help for IntervalMatch
I also recommend reading these posts:
The first one is by a Qlik veteran who writes extremely clearly. I think it gets to what you want to achieve.