Categorical variable dimension table generation
Merged with upstream