Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

GetNthRecSetUnq ( fieldName ; recordNumStart; recordNumEnd )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 3.9  (39 votes)
  Discuss this Custom Function

doug Jacobs, Restylers' Choice, LLC
http://www.restylerschoice.com

Calculates a return delimited and sorted, values list from related, or local, field data. Eliminating duplicate values fromthe list.

Sample Input:
GetNthRecSetUnq(States,1,"") where there are multiple states

If field values are OH, OH, KY, IN, IN, IN....

it eliminates all duplicate values
Sample Output:
"OH¶KY¶IN....."


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

Creates a return delimited value list of the values from the field specified, beginning with the recordNumStart and ending with recordNumEnd. It only enters the first occurence of a value in the list. If an item appears multiple times it will only be in the list once.

The resultant value list's scope and sort are determined by the source field; thus for local fields the sort is determined by the current sort of records in the found set, for related fields it is by the relationship sort.

This single Custom Function can replace Copy All primary keys of a foundset practice as well as the use of ValueListItems() to create a value list of related values for other relationships.

This function is perfect for creating field value lists for selecting a range of records where the value list must change to reflect the data in the found set.

Parameters:

fieldName - Any local field, related field, or an expression that returns a field. NOTE: For repeating fields this Custom function will only see the first repetition, per record. Also, Globals will behave similarly and the global will be display once for each record.

recordNumStart - The record number from which you want to begin getting data. A null ("") or 0 value will set the start at the first record.

recordNumEnd - The record number after which you want to stop getting data. A null ("") or 0 value will evaluate until the the last record is reached. This parameter is inclusive, thus 10 will end the value list with the 10th record, including the contents of the field in that record.

Output Format:

A return delimited text value list of the the contents of fieldName dictated by the provided start and end record numbers.
Note: The result of GetNthRecordSet() will not be updated when the record referred to by GetNthRecordSet() is a record other than the one in which the calculation is currently being evaluated.

Examples:

Given the following related Field data for Clients::State:
Related Record 1 = OH
Related Record 2 = KY
Related Record 3 = IN
Related Record 4 = OH

GetNthRecordSet ( Clients::State ; 2 ; 3 ) = OH¶KY¶IN

GetNthRecordSet ( Clients::State; "" ; "" ) = still returns OH¶KY¶IN due to it elminating duplicates

GetNthRecordSet ( ParentFirstName ; 30 ; "" ) = Value list beginning with the 30th parent name till the last record in current found set, in sort order.

Special Thanks: To Jonathan Mickelson, for posting the GetNthRecordSet function which was used as the basis for this version.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

There's an error on your CF's parameters' it's supposed to be "recordNumStart" and "recordNumStart" end instead of "start" and "end", respectively.

Edward Lemos, Sao Paulo Brazil
November 01, 2009 10:21pm

This may be an error or my misunderstanding of how it is supposed to work.

If your related child record set is not sorted by the field you are working with, it just returns all values, not just one occurrence of each value.

Ed Uncle, Ware, UK
November 02, 2011 3:38am

I can't get this function to load. As noted above, there is an error with recordNumStart. What is the fix for this?

Cody, Houston, TX
April 02, 2012 10:44am

Got it working, but as Ed notes above, it does not seem to work apart from record entry order.

Cody, Houston, TX
April 03, 2012 9:00am

Cody could you explain how you managed to modify the function to get it working?

I've re-defined the parameters as mentioned by Ed, yet I can't seem to get parameters property specified.

Greg, Minneapolis, Mn
July 03, 2012 12:19pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 3 + 7 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)
2. MonthYearList ( startmonth ; startyear ; numbermonth ; short )
  (Mon, Oct 16, 3:38am)
3. ErrorDescription ( errorNumber )
  (Wed, Sep 27, 2:51am)
4. decodeEntities (text)
  (Wed, Sep 27, 1:22am)
5. HexidecimalToNumber ( HexidecimalValue ; counter )
  (Mon, Sep 25, 12:39pm)
6. FixedFieldConverter ( Fieldname ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ; f8 ; f9 ; f10 ; f11 ; f12 ; f13 ; f14 ; f15 ; f16 ; f17 ; f18 ; f1
  (Fri, Sep 15, 12:34pm)
7. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
8. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)

RSS Feed of Custom Functions