November 17, 200421 yr 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.
November 17, 200421 yr How are these lists constructed? Are these separate tables of records or just two fields with something to separate the items?
November 17, 200421 yr 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" );
November 18, 200421 yr Or you can eliminate the repList1 and 2 calculations and change your combinedcalc to Let([ R = Get(CalculationRepetitionNumber); L1 = Substitute( Extend(list1); ", ";
November 18, 200421 yr Author 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?
November 19, 200421 yr Author 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.
Create an account or sign in to comment