Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Thabang231
Contributor III
Contributor III

Separate or Trim Field into 2 values

Hi There, I would like assistance on separating field or trimming it into 2 parts, so i can connect that field with the other field from other file. see examples

DEV25, DEV29,DEV45,DEV19,PRO23,PRO353,PRO43,PRO22

I need to only be able to focus on the DEV or PRO part and separate them to numbers, because the field i want to connect with has only numbers such as 25,29,45,19,23,353,43,22,

 

Your help will be highly appreciated.

 

Labels (1)
4 Solutions

Accepted Solutions
Or
MVP
MVP

Left(Field,3) and Mid(Field,4,999) should be the simplest way in this scenario.

View solution in original post

Sayed_Mannan
Creator
Creator

You can achieve this by using IF statement

IF(Field2=Field1,'yes','no') as flag

Where Field2 is other Data Source Field.

 

Please note for doing this you need to connect both tables first either making both fieldname common or by using joins, then you can apply above logic.

View solution in original post

Sayed_Mannan
Creator
Creator

you can also apply below logic

Left(Field1,3) -> It will give Dev OR Pro
Right(Field1,(Len(Field1)-3)) -> It will give numbers i.e 25,29 etc

View solution in original post

Thabang231
Contributor III
Contributor III
Author

Thank you @Or  and @Sayed_Mannan  The solutions worked. 

View solution in original post

5 Replies
Or
MVP
MVP

Left(Field,3) and Mid(Field,4,999) should be the simplest way in this scenario.

Thabang231
Contributor III
Contributor III
Author

Thanks so much the solution works,

 

now i need to create a field which returns Yes else No, 

in a scenario where field1 value is 3421 and if it matches with value on other data source field return Yes if not return No.

 

 

 

Sayed_Mannan
Creator
Creator

You can achieve this by using IF statement

IF(Field2=Field1,'yes','no') as flag

Where Field2 is other Data Source Field.

 

Please note for doing this you need to connect both tables first either making both fieldname common or by using joins, then you can apply above logic.

Sayed_Mannan
Creator
Creator

you can also apply below logic

Left(Field1,3) -> It will give Dev OR Pro
Right(Field1,(Len(Field1)-3)) -> It will give numbers i.e 25,29 etc

Thabang231
Contributor III
Contributor III
Author

Thank you @Or  and @Sayed_Mannan  The solutions worked.