Brian Dunning's FileMaker Custom Functions

ListFound_Conditionnal ( Field ; start ; filterField ; filterItem )

List of values of one Field of a table under condition of the value (filterItem) of a second field (filterField) of the same table

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

Frederic Bruckert   Frederic Bruckert - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
ListFound_Conditionnal ( Name; 1; Job; "nurse")


TABLE:Employees
Field::Name, Field::Job


Field::Job has several values (doctor, secretary, nurse,..)
  Sample output:
heather
nicole
alexis
lisa
nikki

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

This function is useful to summarize fields of a table without table occurency.

it's easy to load the result in a global variable to use it in the solution.

 

Comments

Bruce Robertson   Bruce Robertson
Feb 6, 2011
The function can be simplified as shown below.
Oddly, I find the empty string before the second getNth is required to ensure the calc operates properly.

Case( start <= Get(FoundCount) ;

Let([
thisvalue = Case( GetNthRecord ( filterField; start ) = filterItem ;
"" & GetNthRecord ( field ; start ) );

next = ListFound_Conditional ( Field ; start + 1; filterField; filterItem ) ];

List( next; thisValue )
)
)
 
Bruce Robertson   Bruce Robertson
Feb 6, 2011
Oops, that should be list( thisValue; next)
 
Frederic Bruckert   Frederic Bruckert
Feb 6, 2011
Hi Bruce.
Thanks for your comment.That's another approach, more simple and clear. I did not think to simplify, because my CF was working.
Best regards.
 
Andrew Yates   Andrew Yates, London, UK
Feb 18, 2016
I seem to be having really mixed results with this. It's exactly what I've been looking for, but I'm getting this to list a related field. The results show as expected. But it seems that if I narrow down the search (of the parent table where the list field is), it shows up blank. Any thoughts?
 
arthur   arthur
Nov 11, 2019
I experience the same thing as Andrew. The full list is generated when the parent file is showing all clips, but when narrowing down information gets lost. Very difficult for me to troubleshoot this one.
 

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: