ValuesIntersection ( ValuesListA ; ValuesListB ; passNullStringHere )
Returns the Values that are in BOTH ValuesListA and ValuesListB.
			 
  
  
  
  Average rating: 4.8 (18 votes)  Log in to vote
    Average rating: 4.8 (18 votes)  Log in to vote		
| Hal Gumbert            - Show more from this author CampSoftware http://www.campsoftware.com | 
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
			ValuesIntersection ( ValuesListA; ValuesListB; passNullStringHere )
Hal Gumbert, http://campsoftware.com
Returns the Values that are in BOTH ValuesListA and ValuesListB.
Parameters:
ValuesListA = List of Return delimited data.
ValuesListB = List of Return delimited data.
passNullStringHere = Pass in "" as it's used to store the list of Values in both ValueLists.
Return Value:
The Values that are in BOTH ValuesListA and ValuesListB
Input: ValuesIntersection ( "1¶2¶3¶4¶5" ; "4¶2¶3" ; "" )
Output: 2¶3¶4		
Comments
| eos, Teg May 11, 2015 | ||
| Is that different from what FilterValues() does? | ||
| Hal Gumbert, Orlando, FL May 11, 2015 | ||
| It seems to have the same result! | ||
| eos, Teg May 11, 2015 | ||
| Indeed … :-) And just for kicks: // ValuesIntersection ( listToCheck; checkList ) Let ( [ $i = $i + 1 ; currentValue = GetValue ( listToCheck ; 1 ) ; remainingToCheck = MiddleValues ( listToCheck ; 2 ; ValueCount ( listToCheck ) - 1 ) ; remainingToCheck = Left ( remainingToCheck ; Length ( remainingToCheck ) - 1) ; isMatch = PatternCount ( ¶ & checkList & ¶ ; ¶ & currentValue & ¶ ) ; // where you would use FilterValues() – if it existed … ;-) $matchCount = $matchCount + isMatch ; matchValue = Case ( isMatch; Case ( $matchCount > 1 ; ¶ ) & currentValue ) ] ; matchValue & Case ( ValueCount ( remainingToCheck ) ; ValuesIntersection ( remainingToCheck ; checkList ) ; Let ( [ $i = "" ; $matchCount = "" ] ; "" ) ) ) | ||
| Hal Gumbert, Orlando, FL May 13, 2015 | ||
| Nice... I like how you removed my unneeded parameter. | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.
