PRD-5276: Fix OLAP results when using complex hierarchies