1. A computer-implemented method for calculating a distinct count value from data stored in a hierarchical database, a counting measure being defined in the hierarchical database such that the counting measure is associated with members of a first category of data to be stored in the hierarchical database, the method comprising: receiving a query that identifies the counting measure; querying the hierarchical database to identify members of the first category of data that are stored in the hierarchical database; generating a data structure that includes the members of the first category of data that are stored in the hierarchical database; and calculating one or more distinct count values for the members of the first category of data that are stored in the hierarchical database.