Rainy Pass Posted November 17, 2004 Posted November 17, 2004 What may be the best approach to combining two or more lists into one? i.e, Word list of a,b,c... Word list of x,y, z combine to a list such as: ax, ay, az, bx, by, bz, ... The lists will change periodically. There will be multiple lists. Of course other data is associated with groups of the final list.
Ender Posted November 17, 2004 Posted November 17, 2004 How are these lists constructed? Are these separate tables of records or just two fields with something to separate the items?
-Queue- Posted November 17, 2004 Posted November 17, 2004 If the lists are list1 and list2, create two repeating calculation fields with the maximum number of repetitions as you allow list items. repList1:= MiddleWords( Extend(list1); Get(CalculationRepetitionNumber); 1 ) repList2:= MiddleWords( Extend(list1); Get(CalculationRepetitionNumber); 1 ) Then create a repeating calculation of Get(CalculationRepetitionNumber) with as many repetitions as the product of the number of reps in repList1 and repList2, and a combined repeating calculation with the same number of reps, defined as Let([ R = Get(CalculationRepetitionNumber); L1 = Count(repList1); L2 = Count(repList2) ]; Case( R <= L1 * L2; repList1[ Int((R - 1) / L2) + 1] & repList2[ Mod( R - 1; L2 ) + 1 ] ) ) Then create a valuelist based on self|serial::combinedcalc, sorted by the second field, specified as the Get(CalculationRepetitionNumber) field, where self|serial is a self-relationship from serial to serial, so that only the current record's field is used for the value list. Finally, create an unstored calculation text field of Substitute( ValueListItems( Get(FileName); "combinedvaluelist" );
-Queue- Posted November 18, 2004 Posted November 18, 2004 Or you can eliminate the repList1 and 2 calculations and change your combinedcalc to Let([ R = Get(CalculationRepetitionNumber); L1 = Substitute( Extend(list1); ", ";
Rainy Pass Posted November 18, 2004 Author Posted November 18, 2004 They are not constructed yet. Starting from scratch, looking for the best way to put them together in FM7. The actual data is currently in Word and the import is not an issue. I am sure I can script the solution but, I would prefer somthing more dynamic. I quess I want to know if there is a better way. Kill any bees lately?
Rainy Pass Posted November 18, 2004 Author Posted November 18, 2004 Thanks for the thorough reply. I will give it a shot.
Rainy Pass Posted November 19, 2004 Author Posted November 19, 2004 The secound solution is short and sweet and is exactly what I need. The first part however, blew me away. I had no idea a value list could be worked is such a way. Thanks again.
Recommended Posts
This topic is 7308 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now