Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to avoid line gap in Address when using Report Text tool

kas
8 - Asteroid

Hello,

 

I'm using the Report Text tool to format a letter for mass mailing, and some of the addresses have more than one address line, but when there aren't additional lines, it leaves a gap; anyway around this?

 

Below is the format used in the Report Text tool currently:

Report Text Tool example.jpg

 

So if there is no Address Line 2 or 3 in the data, it will leave a gap in the output, for example:

Jane Doe

123 Main St.

 

Anytown, ME 11111

 

But would like it be:

Jane Doe

123 Main St.

Anytown, ME 11111

 

Thank you,

Kim

3 REPLIES 3
binuacs
21 - Polaris

@kas which version of designer are you using? I don't see the extra line break  if there is no field value present

image.png

GMG0241
8 - Asteroid

You can create a new column called 'Address' via the formula tool. There you can use if statements/trims/etc to check if the column is empty and either do/don't add it to the 'Address' column. Then, render the address column through the reporting tool.

E.g. 1:

Address=

[Name] +"

"+[Add1]+"

"

 

Address =
IF !IsEmpty([Add2]) THEN
[Address]+[Add2]+"

"

ELSE

[Address]

ENDIF

 

Address = 

IF !IsEmpty([Add3]) THEN
[Address]+[Add3]+"

"

ELSE

[Address]

ENDIF

 

Address = 

[Address]+[City]+", "+[State] +" " + [Zip]

 

E.g. 2:

 

Using REGEX:
Address = [Name]+"_"+[Add1]+"_"+[Add2]+"_"+[Add3]+"_"+[City]+", "+[State]+" "+[Zip] //_ represents where you would want a line break

Address = REGEX_REPLACE([Address],"_+","_")

Address = REPLACE([Address],"_","

")

kas
8 - Asteroid

@binuacs 

 

Using Version: 2023.2.1.194 Patch: 5

Labels
Top Solution Authors