Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
JSey
Creator
Creator

Adding space to string in Tmap

Hi

 

I'm trying to integrate data from a csv file to Salesforce.  The columns are street number, street name and unit number, and let's say I would like to keep them in that order.  Not all address will have a unit number.  Currently I have 2 tmaps

 

Tmap1: row1.B1_Borrower_Unit_Number==null?"": " "+row1.B1_Borrower_Unit_Number

   It does the same for street name (add space before the street name)

Tmap2: concatenates using street number + street name + unit number

 

The issue is the " " before the string is getting removed

 

Current output:

23Sheppard Avenue55

 

Desired output:

23 Sheppard Avenue 55

 

Please help?  Thanks

Labels (4)
4 Replies
Anonymous
Not applicable

Hi,

 

   I got the address correctly as shown below.

0683p000009M5lP.png

0683p000009M5hx.png

 

The function in simple form is as shown below.

 

Relational.ISNULL(row1.borrower_unit_number)?
         row1.street_number+" "+ row1.street_name 
       : row1.street_number+" "+ row1.street_name+" " + row1.borrower_unit_number 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

JSey
Creator
Creator
Author

Hi Nikhil

 

Thank you for your help.  I actually simplied it a bit.  In actually, there is:

 

Street number

Street Name

Street Type

Street Direction

Unit Number

 

To add space in the second tmap using conditional statements, there would be a lot of permutations and very complex.  I was hoping to be able to add a space to the front of street name, type, direction and number in the first tmap so it would only have the space when unit number, direction are not null.

Anonymous
Not applicable

Hi,

 

    Ideally I would never recommend to do address validation manually. Talend has got Address standardization components where you can call the corresponding APIs to make the address value in right format. Please see the screen shot below.

 

0683p000009M5le.png

 

My recommendation will be to utilize these components along with subscription to corresponding services to standardize the data especially we are in the era of Privacy laws like GDPR, California Privacy law etc.

 

  If you will have to do it manually, you will have to handle all the permutations and combinations also in manual fashion.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

JR1
Creator III
Creator III

Hi

Have you tried to put it like this:

row1.B1_Borrower_Unit_Number == null ? "" : (" " + row1.B1_Borrower_Unit_Number)

Regards