1. A computer readable storage medium, comprising executable instructions to: retrieve a dataset from a data source wherein the dataset includes a first set of categories; build a data structure that represents the dataset, wherein the data structure stores a plurality of attribute combinations and a plurality of counts wherein a representative count in the plurality of counts indicates how many times a corresponding attribute occurs in the dataset, wherein each attribute combination of the plurality of attribute combinations is selected from a record of the dataset and a partial record of the dataset; calculate a first plurality of merit values for the first set of categories; order the first set of categories based on a criterion; return the first set of categories; accept a filter; copy a set of applicable branches from the data structure wherein an applicable branch of the set of applicable branches complies with the filter; build a new data structure using the set of applicable branches, wherein the new data structure comprises a second set of categories; calculate a second plurality of merit values from the second set of categories; retrieve a filtered set of data from the data source; and return the filtered set of data and the second set of categories.