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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using StringHandling.CHANGE to replace characters

Hello,

 

I have some code that worked fine last time I ran my job about a year ago (it is a yearly file), but now isn't giving me the same results.

 

Incoming data examples:

 

00001-010-C
00001-010-D
00001-010-E
00001-010-F
00001-010-H
00001-010-I
00001-010-J
00001-010-L
00001-010-M

Output data:

 

391000001001
391000001005
391000001006
391000001010
391000001010
391000001010
391000001010
391000001010
391000001010

 

Code: 

 

"3910" + StringHandling.CHANGE(MiTaxINput.TaxID ,"\\D","")

 

I need to keep the letter at the end, but not sure what to change to make that happen.

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi,

 

   Please refer the below flow.

0683p000009M68s.png

 

The functions are added in tMap as shown below.

0683p000009M68x.png

 

The functions used are as shown below.

 

second_time      ->           row1.data.indexOf("-", row1.data.indexOf("-") + 1)

first_part       ->           "3910" + StringHandling.CHANGE(row1.data.substring(0,Var.second_time) ,"\\D","") 

second_part      ->           row1.data.substring(Var.second_time+1)

I would request to spare a second to mark the topic as resolved. Kudos are also welcome 🙂

 

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 🙂