November 30, 200520 yr I'm trying to build a list of similiar values in one field based on the quantity of values in another field (para. delimited - not repeating field) For example: Field_A = "abc" Field_B = "pqr¶stu¶vwx" //3 values The result should be: Field_C = "abc¶abc¶abc" //3 values of Field_A I want the value in Field_A to be repeated in field_C by the valuecount of Field_B. Thanks.
November 30, 200520 yr Custom Function: Set_Reps(Field_A; repNum; currentRep; result) Let([ a = Field_A; b = result; c = GetAsNumber(repNum); d = GetAsNumber(currentRep)]; If( d > c; b; Set_Reps(a; c; d + 1; b & a & "¶")) Then Call it like this Set_Reps(Field_A; PatternCount(Field_B; "¶") + 1; 1; "") Then you only have to worry about removing the trailing return. Didn't get to test it, but it looks pretty close to right. David Singleton.
November 30, 200520 yr Field_B = "pqr¶stu¶vwx" Or, without a recursive custom function, you can try this simple calc: [color:green]Substitute ( Filter ( Field_B & "¶" ; "¶" ) ; "¶" ; Field_A & "¶" ) If Field_B may contain extra carriage returns or empty rows, try this other: [color:green]Substitute ( Filter ( Substitute (TrimAll ( Substitute ( Field_B ; "¶" ; " " );1;0 ) & "¶" ; " " ; "¶" ) ; "¶" ) ; "¶" ; Field_A & "¶" ) :
December 1, 200520 yr Author David; You were thinking the same way I was. Daniele: Works great! Thanks to both.
Create an account or sign in to comment