Brian Dunning's FileMaker Custom Functions

GetPermutations ( text )

Finds all permutations of a return-delimited list of values.

  Average rating: 4.6 (30 votes) Log in to vote

Jed Verity   Jed Verity
Verity Solutions
mailto:junk@veritys.com

Share on Facebook Share on Twitter

  Sample input:
GetPermutations ( field )
  Sample output:
/* if the field contains
1
2
3
*/

1
2
3

1
3
2

2
1
3

2
3
1

3
1
2

3
2
1

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

This function takes a return-delimited list of values and finds all possible combinations of the values. The results are delimited with single returns between values and double returns between combinations (see sample output). The returns in the output can then be substituted with whatever delimiters you want.

 

Comments

Martin Turner   Martin Turner, Marlcliff UK
Jan 7, 2016
This is a great function.
However, if you have a 'b' in the text (and, I suspect, a 'z' or a 'u'), it gets confused and inserts '_zub' in the output.

By replacing the term '_zub' in the function with ∂, the function works correctly — provided that '∂' is not then used in the tex.
 
John Segers   John Segers
Apr 30, 2020
Hi there, Thx for the good work. However... When I use the function with the word "vraag" (question) it returns rvgga and rgvva for instance. I know how hard this stuff is. I don't even try to doe it in a recursive function. Even in a script I can't manage it. But I thought I should let you know, maybe it's easier for you to correct.
 
John Segers   John Segers
Apr 30, 2020
I tried the function with a number substitution for the second 'a', that i substitute back with an 'a' aftwards. That works fine
 

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: