An idiomatic approach to generating power sets using the Set collection subsets ,
implicit class groupCols[A](val cols: List[A]) extends AnyVal { def grouping() = cols.toSet.subsets.filter { _.size > 1 }.toList }
Then
List("age","company","country","gender").grouping
provides
List( Set(age, company), Set(age, country), Set(age, gender), Set(company, country), Set(company, gender), Set(country, gender), Set(age, company, country), Set(age, company, gender), Set(age, country, gender), Set(company, country, gender), Set(age, company, country, gender))
Please note that the set includes an empty set and a set for each element in the original set, here we filter them.