Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask 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