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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pra_kale
Creator III
Creator III

How to replace character

Hi,

In my data i have column member number which is having length 5. In that few members code is like '01ED2', '01EF3' ,'01E12','02E45','03E99'.

Now my challenge is I want to replace after E if only if last 2 characters are numbers. Means if member number is '01E12' then it should be '01E_12', '02E45' then '02E_45', '03E99' then '03E_99', for rest members there is no change.


Appreciate your help in this.

Thanks in advance.



1 Solution

Accepted Solutions
joseph_morales
Creator III
Creator III

A simple method in the Script is this.
A:
load
Field,
if(IsNum(right(Field,2)) and mid(Field,3,1) ='E',left(Field,3)&'_'&right(Field,2),Field) as NewField;
LOAD * INLINE [
Field
01ED2
01EF3
01E12
02E45
03E99
]
;
Regards
Best Regards,
Joseph Morales

View solution in original post

2 Replies
joseph_morales
Creator III
Creator III

A simple method in the Script is this.
A:
load
Field,
if(IsNum(right(Field,2)) and mid(Field,3,1) ='E',left(Field,3)&'_'&right(Field,2),Field) as NewField;
LOAD * INLINE [
Field
01ED2
01EF3
01E12
02E45
03E99
]
;
Regards
Best Regards,
Joseph Morales
pra_kale
Creator III
Creator III
Author

Thanks Joseph..It is working.