In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Generate all possible combinations of values from a column

JackTequila
5 - Atom

Hi all,

 

My doubt is, how to generate all possible combinations of elements from a given list and assign each combination a unique group ID? Here are some examples

 

Input 1:

Value
A
B

 

Output 1:

GroupIDValue
1A
1B
2A
3B

 

Input 2:

Value
A
B
C

 

Output 2:

GroupIDValue
1A
1B
1C
2A
2B
3A
3C
4B
4C
5A
6B
7C

 

OBS: The real case input right now has 15 values, and it should generate 32767 groups (2^n-1).

 

Thanks.

11 REPLIES 11
Qiu
21 - Polaris
21 - Polaris

@JackTequila 
I was not really considering the computing cost, and I guess I need to keep that in mind. 😁
@SPetrie gives very good one and I will definitely going to study it. Thanks.

Qiu
21 - Polaris
21 - Polaris

@SPetrie 
Maybe you should submit this as an idea for weekly challenge. 😂

Labels
Top Solution Authors