Brian Dunning's FileMaker Custom Functions

matchListAB ( ListA ; ListB ; match_Value ; match_operator ; getN )

Returns items from ListB where corresponding value of ListA meet condition. Option to return item position instead.

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

Bruce Robertson   Bruce Robertson - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
Let([
ListA = "9¶8¶1¶2¶3¶4";
ListB = "9A¶8A¶1A¶2A¶3A¶4A";
matchValue = "3";
matchop = ">=" ];
MatchlistAB( ListA; ListB; matchValue; matchop; 1 )
)
  Sample output:
1
2
5
6

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

Returns list of items from listB where cfMatch result is 1 for corresponding value of ListA

If ListB is empty then items from ListA are returned where cfMatch result is 1
If getN is 1 (or greater) then instead of returning the matching item, its position in the list is returned.
ListB can be empty; but otherwise an error is returned if valueCount ListB < valueCount ListA.

Dependent on custom function cfMatch
Recursive function

Bruce Robertson - Concise Design
Last updated 1/31/2010

Examples
Let([
ListA = "9¶8¶1¶2¶3¶4";
ListB = "9A¶8A¶1A¶2A¶3A¶4A";
matchValue = "3";
matchop = ">=" ];
MatchlistAB( ListA; ListB; matchValue; matchop; 0 )
)
RESULT:
9A
8A
3A
4A

Let([
ListA = "9¶8¶1¶2¶3¶4";
ListB = "9A¶8A¶1A¶2A¶3A¶4A";
matchValue = "3";
matchop = ">=" ];
MatchlistAB( ListA; ListB; matchValue; matchop; 1 )
)
RESULT:
1
2
5
6

 

Comments

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 15 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:

Under construction. Email me your wish list for improvements.