The rollup and the drilldown are quite frequent based on dimension hierarchies in on-line analytical processing (OLAP), but prefixCube does not directly support dimension hierarchies. The PrefixCube is extended for incorporating hierarchical data cubes, i.e. cubes with hierarchical dimensions ,thus obtaining HierPrefixCube. HierPrefixCube retains advantages on computation and organization of PrefixCube, and it can directly support aggregate queries on levels of the dimension hierarchy.