Brian Dunning's FileMaker Custom Functions

ItemIndexPosition ( Text ; SearchString )

To find the position of a value in a given list

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

Saigopal Das   Saigopal Das
Mindfire Solutions
http://www.mindfiresolutions.com/

Share on Facebook Share on Twitter

  Sample input:
ItemIndexPosition ( "1¶2¶14¶5¶222¶12¶22¶42¶11¶23¶44" ; "22" )
  Sample output:
7

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

This one line function first trims the list upto the search string and then takes the valuecount which will be index position of the searched string.

Text ="1¶2¶14¶5¶222¶12¶22¶42¶11¶23¶44"
SearchString = "22"

Left ( Text ;Position ( ¶ & Text & ¶ ; ¶ & SearchString & ¶ ; 1 ; 1 ))

= "1¶2¶14¶5¶222¶12¶2"

ValueCount ("1¶2¶14¶5¶222¶12¶2" ) = 7

 

Comments

Tom Fitch   Tom Fitch
Jul 30, 2015
Or if you prefer:
http://www.briandunning.com/cf/1300
 

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.

Under construction. Email me your wish list for improvements.