better filtering, current period detection (default to 1)