Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splitting multi-value fields 1

Status
Not open for further replies.

susiesunshine

Technical User
Mar 28, 2002
34
US
The database has name of the person as one field, then the list of their pcs as another multi-value field. I would like to have the report split the multi-value field and repeat the name of the owner. For example, if I have 3 pcs, instead of my name once with 3 machine names in the other field I would like to see my name 3 times, one per each pc. Is that an array? How would I do this?
 
That would depend on how these fields are split...

Please post basic technical information with posts rather than requiring people to guess.

An array is one possible solution, I'll assume that they are seperated by a space:

whileprintingrecords;
stringvar array MyTest:= split({table.field}," ");
join(MyTest,chr(13))

Replace the space " " with whatever character that deliminates your data.

Then use this formula for diswpla and select the can grow option from the format field.

-k
 
I'm guessing you want to export your data. To get the data in separate rows, I think you would need to insert additional detail sections up to the maximum number of applications per person. Then create a series of formulas for the application like:

//{@Firstapp} to be placed in detail_a:
if ubound(split({table.applics},",")) >= 1 then
split({table.applics},",")[1]

Replace the comma with your separating character.

//{@Secondapp} to be placed in detail_b:
if ubound(split({table.applics},",")) >= 2 then
split({table.applics},",")[2]

//etc.

Then create corresponding formulas for the person field:
//{@person1} to be placed in detail_a:
if ubound(split({table.applics},",")) >= 1 then {table.person}

//{@person2} to be placed in detail_b:
if ubound(split({table.applics},",")) >= 2 then {table.person}

//etc.

Then format each detail section to "suppress blank section". If you are actually using a number for the person field, also be sure to format it to suppress if zero, so that the section will suppress appropriately.

-LB
 
Thank you both for your help! I was going to export, so the second solution worked better for me. Again, thank you and have a wonderful holiday!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top