Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6930 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted


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.

Posted

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 & "¶" ) :

Posted

David; You were thinking the same way I was.

Daniele: Works great!

Thanks to both.

This topic is 6930 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.