Brian Dunning's FileMaker Custom Functions

AllCombinations ( theString )

Lists all possible combinations of one or more characters contained in a string

  Average rating: 4.2 (32 votes) Log in to vote

Michael Kupietz   Michael Kupietz - Show more from this author
Michael Kupietz FileMaker Consulting
http://www.kupietz.com

Share on Facebook Share on Twitter

  Sample input:
AllCombinations ("abcd")
  Sample output:
a
ab
abc
abd
abcd
ac
ad
acd
b
bc
bd
bcd
c
d
cd

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This will list all possible subsets of one or more characters from a string. For example, AllCombinations ("abc") will return:

"a
ab
ac
abc
b
c
bc"

See function AllWordCombinations to perform the same operation on a string of words (such as "apple bed carrot") instead of single characters.

 

Comments

Rudy Di Maggio   Rudy Di Maggio, Crema, Italy
Apr 10, 2013
Thanks Michael,

this function is very helpful expecially when you have to manage (as I do) words for puzzle words games.
It allows to quickly see how a word can be anagrammed.

@rudydimaggio
 
Michael Kupietz   Michael Kupietz, Michael Kupietz FileMaker Consulting
Apr 10, 2013
Thanks for your comment- always glad to hear someone found one of my posts useful.
 
Cekari   Cekari, Sweden
Sep 13, 2013
Nice one Mikel,

but thats not all combinations more a combination from a-z
ie "abc" can be

a
ab
abc
ac
b
c
bc
.
.
.

but also

ba
bac
ca
cab
bca
cb
.
.
.

and a stupidly long list with long text-strings :-)

Cheers /Cekari
 
Michael Kupietz   Michael Kupietz, Michael Kupietz FileMaker Consulting
Sep 13, 2013
You're right, it should have been "AllPermutations". Cheers!
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: