Jump to content

Finite Delimited List


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

Recommended Posts

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.

Link to comment
Share on other sites


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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 6742 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.