Add period support to query.granularity