Brian Dunning's FileMaker Custom Functions

Index ( text ; wordnumber ; characternumber ; result )

Create an index of given text value

  Average rating: 4.3 (29 votes) Log in to vote

Michael Bijnens   Michael Bijnens
freelance developer
/

Share on Facebook Share on Twitter

  Sample input:
Index ( "Apple Orange Banana ; "" ; "" ; "" )
  Sample output:
A
Ap
App
Appl
Apple
O
Or
Ora
Oran
Orang
Orange
B
Ba
Ban
Bana
Banan
Banana
Apple Orange Banana
*

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

This cf creates an index of the given text value.
I use this cf in a calculated field ( unrelated ) to create an index of the calculated text value. It can be used for a search in a portal field. ( portal has to be filtered with a PatternCount function ).

PatternCount ( "field with index" ; "global search field" ) > 0
and
( if u want to show all records )
IsEmpty ( "global search field" )

 

Comments

Lee Smith   Lee Smith
Oct 18, 2014
There is a typo in your CF, the Parameter uses character number as a Parameter and the calculation uses characternumber.
 
unix   unix, Japan
Oct 19, 2014
I think this is not useful in the case, since PatternCount doesn't use index.
 
Michael   Michael, Belgium
Oct 20, 2014
@ Unix

PatterCount doesn't use the Filemaker field index, thats true, but this cf create a similar index in a valuelist so PatternCount can only be useful ;-)
 
unix   unix, Japan
Oct 21, 2014
Ok, I guess your usage may be not PatternCount,
FilterValues ( "field with index" ; "global search field" ) <> ""
for matching every head of words against search field.
 
Alex   Alex
Jul 3, 2018
Hello Michael, I love your function.

I was wondering, is there any way to remove the full text and the "*" character at the end, and keep only the index?

All the best,

Alex
 

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: