October 13, 200520 yr I have a list of records in a "child" database, for which some data is repeated. Think a list of students where each student may have multiple records, one for each of her classes. I need a field which says basically "which portal row the record would appear on in the 'parent' record." If David has seven classes, I want his first record to say 1; the second, 2; etc. I don't want a summary field. GetSummary() is not of much use in my opinion. Is there a way to hard code this field? I have seen others do cool things with GetNthRecord, and I have adapted it to my own use (i.e. replacing GetValueListItems). I feel the answer is close. I would value and appreciate and feedback you could offer. DSW
October 13, 200520 yr Hi, Sorry but can you explain using another example to what exactly you are looking for.
October 13, 200520 yr Take a look at the following Custom Function: PositionValue ( text; searchValue; start; occurrence ) At: http://www.briandunning.com/filemaker-custom-functions/list.php If you already know how to use GetNthRecord to get the list, just pass it to this CF. [Yikes, Brian's list is temporarily down. Here's the text of the CF, which I've saved: PositionValue ( text; searchValue; start; occurrence ) Geoff Wells, DataIsland Software LLC http://onestopfilemaker.com Same as the Position function but for Values Sample Input: PositionValue ( MyList; "Seven"; 1; 1 ) MyList contains One hundred Two hundred Thirty Four thousand Five hundred Six hundred Seven Eighty eight Sample Output: 7 ---------- code ------------ Let ( adjustedText = "�" & text & "�" ; If ( Position ( adjustedText ; "�" & searchValue & "�" ; start ; occurrence ) = 0 ; 0 ; ValueCount ( Left ( text ; (Position ( adjustedText ; "�" & searchValue & "�" ; start ; occurrence ) - 1) + Length ( searchValue ) ) ) ) ) ------------------ Description: In the same way that the Position function provides the number of a character position in a text string, PositionValue calculates the value number of a text string in a return delimited list. Edited October 13, 200520 yr by Guest
October 14, 200520 yr Author Fenton, Wow did that hit the spot! Just perfect. By applying the PositionValue() CF to the result of the AppendNth (a.k.a. GetNthRecord()) CF applied to a self-referencing relationship, I get the local value for the nth related record. Now I can find a single record for each among a group "child" records. Also, finally, no ValueListItems(). Big help! Many Thanks. DSW
Create an account or sign in to comment