FilterValues.diff ( )

Function stats

Average user rating
148
407
9999
Support
FileMaker 8.5 +
Date posted
28 December 2016
Last updated
29 December 2016
Version
Recursive function
Yes

Author Info
 Steve Allen

15 functions

Average Rating None

author_avatar



 

Function overview

Prototype

FilterValues.diff  ( A;   B )


Parameters

A  First set (list)


B  Second set (list)


Description

FileMaker has set Union and Intersection natively (List and FilterValues respectively). This gives also set Difference: All A not in B, or A - B.

Examples

Sample input

FilterValues.diff ( List ( "A" ; "B" ; "C"; "D" ; "E" ) ; List ( "B" ; D" ; "F" ) )


Sample output

A
C
E

 

Function code

//all A not in B
Let ([
    this        = GetValue ( A ; 1 )
;    next        = Case ( ValueCount ( A ) > 1 ; Right ( A ; Length ( A ) - Position ( A ; "¶" ; 1 ; 1 ) ) ; "" )
;    output        = List ( Case ( not ValueCount ( FilterValues ( B ; this ) ) ; this ) ; Case ( not IsEmpty ( next ) ; FilterValues.diff ( next ; B ) ) )
];
output
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/407

    Prototype: FilterValues.diff( A; B )
    Function Author: Steve Allen (http://www.fmfunctions.com/mid/148)
    Last updated: 29 December 2016
    Version: 1.3

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (7)