Skip to Content
0

Multiple lines

Apr 20, 2017 at 02:20 PM

54

avatar image

I am creating a report that one field can have more than 1 entry, currently my report is pulling the data in to more than one lines. For tract ID 2 the report has 2 line of data to show both "Unit Names". What I want to do is create a formula to have the multiple fields show up in to one line and have a "," between the 2 different units.

Instead of seeing this

Martin Unit

(New line) Kirk Unit

I need to do this: Martin Unit, Kirk Unit

Thank you in advance,

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Abhilash Kumar
Apr 20, 2017 at 05:22 PM
0

Matt,

I misunderstood how the records show up.

Modify the formula like so:

WhilePrintingrecords; 
stringvar sub;
numbervar x := x + 1;
IF x = 1 THEN 
sub:= {DUE_DIL_MASTER_VW.UNIT_NAME} 
ELSE( IF NOT ({DUE_DIL_MASTER_VW.UNIT_NAME} IN SPLIT(sub,',')) THEN 
sub:=sub&','&{DUE_DIL_MASTER_VW.UNIT_NAME} ); 
sub

Modify the Rest formula to:

WhilePrintingrecords; 
stringvar sub := '';
numbervar x := 0;

-Abhilash

Show 1 Share
10 |10000 characters needed characters left characters exceeded

As always you are a HUGE help, thank you much for the modification to my original formula.

0
Abhilash Kumar
Apr 20, 2017 at 03:07 PM
0

Hi Matt,

Try:

Replace(Replace({string field},chr(10),"."),chr(13),".")

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded
Matt Kirk Apr 20, 2017 at 04:39 PM
0

This does not work, however I may have figured out a way using this formula in the group footer section.

WhilePrintingrecords; global stringvar sub; IF ONFIRSTRECORD THEN sub:={DUE_DIL_MASTER_VW.UNIT_NAME} ELSE( IF NOT ({DUE_DIL_MASTER_VW.UNIT_NAME} IN SPLIT(sub,',')) THEN sub:=sub&','&{DUE_DIL_MASTER_VW.UNIT_NAME} ); sub

In the group Header section I have a reset so the unit names do not build on one another:

WhilePrintingrecords; global stringvar sub; sub:=""

However the results I get are correct but there is a "," at the beginning and I cannot figure out why. The column is listing the multiple ID fields, ex. ,John Unit A, Kirk Unit B The issue is the "," before John Unit.

Share
10 |10000 characters needed characters left characters exceeded