Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Help to format a text box with address details from multiple fields

Hi all,

i have some property addresses which are all in separate fields.

i.e.

Property Name

Address 1

Address 2

Address 3

Address 4

Post Code

I need to display the address in a text box, so when  a user selects an individual property, they see the details of that property, one of the details is a text box with the full address showing.

some of the address fields are not used for some of the properties

i.e.

property 1 might use all 5 fields

property 2 might only have address1 + 2 and post code

so adding these to a text box will cause missing (blank) lines between the first and last part of the address.

Can someone help with maybe using a nested if statement to check the fields are populated first? I have tried but i can't figure it out.

I have attached a sample.

Thanks

1 Solution

Accepted Solutions
jayanttibhe
Creator III
Creator III

Please try your expression  as :

=if(GetSelectedCount(Property)=1,

if(len(trim(Property)) > 0 ,Property&chr(10))&

if(len(trim([Address 1])) > 0 ,[Address 1]&chr(10))&

if(len(trim([Address 2])) > 0 ,[Address 2]&chr(10))&

if(len(trim([Address 3])) > 0 ,[Address 3]&chr(10))&

if(len(trim([Post Code])) > 0 ,[Post Code])

)

View solution in original post

2 Replies
jayanttibhe
Creator III
Creator III

Please try your expression  as :

=if(GetSelectedCount(Property)=1,

if(len(trim(Property)) > 0 ,Property&chr(10))&

if(len(trim([Address 1])) > 0 ,[Address 1]&chr(10))&

if(len(trim([Address 2])) > 0 ,[Address 2]&chr(10))&

if(len(trim([Address 3])) > 0 ,[Address 3]&chr(10))&

if(len(trim([Post Code])) > 0 ,[Post Code])

)

dplr-rn
Partner - Master III
Partner - Master III

Try below

=if(GetSelectedCount(Property)=1,

Property & chr(13) &

if(len(TRIM([Address 1]))>0,[Address 1]&chr(13))  &

if(len(TRIM([Address 2]))>0,[Address 2]&chr(13))  &

if(len(TRIM([Address 3]))>0,[Address 3]&chr(13))  &

if(len(TRIM([Address 4]))>0,[Address 4]&chr(13))  &

[Post Code]

)