Free Trial

Alteryx Designer Desktop Discussions

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

Help with generating combinations of letters

estherb47
15 - Aurora
15 - Aurora

Hi!

 

Don't know why I'm stumped on this one.

I have a list of unique letters, and I want to generate all combinations of letters

 

For example:

 

Letter

a
b
c

should yield:

Letter
a
b
c
ab
ac
bc
abc


Thanks!!

9 REPLIES 9
DanS
9 - Comet

The attached does what you want (ugly, but gets the job done)

 

I did a self join on a dummy "Group" and from there concatenated all possible combos that don't include identical letters.

 

From there I split them to rows in order to remove the duplicate pairs and did a bunch of grouping and concatenating with no delimiter.

 

Unioned back all possible combos including a combo of all original values at the bottom. 

 

Let me know if that works for you!

sjm
8 - Asteroid

I found a Combination macro in the Gallery that might be helpful: https://gallery.alteryx.com/#!app/Combination/5602ee03a248970eac03bebf

 

"Generates combinations for a set of items.

ex. "a, b, c" generates "a, b, c, ab, ac, bc, abc"

Author: Alex Koszycki

Copyright: Alteryx, Inc. 2015"

mborriero
11 - Bolide

This simple workflow will generate combinations with lengths 1, 2 and N (Where N is the number of the letters given as input).

I hope this helps.

mborriero
11 - Bolide

This iterative macro does actually what you want.

 

Alex Koszycki

Alteryx, Inc.

Alteryx, Inc. 2015

estherb47
15 - Aurora
15 - Aurora

There are unknown tools coming up in this macro. I'm going to try to download the one from the Gallery

mborriero
11 - Bolide

Sorry my bad. Try it now.

estherb47
15 - Aurora
15 - Aurora

Thanks everyone, for your help so far. 

 

The macro from the gallery isn't working for what I need. It generates only an "a" and nothing more. I'll keep plugging away....

 

Best,

Esther

estherb47
15 - Aurora
15 - Aurora

this works, thank you! Now to turn it into an iterative macro that can handle from 1-n letters......

mborriero
11 - Bolide

Does this work for you?

Labels
Top Solution Authors