Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Adding one char (3) to to each char in a string

Hi All, I need to create the new field based on existing field. I need to add 3 to each number in a field.

for ex:

Field --> NewField

325 --> 333235

A3C  --> 3A333C

4518 --> 34353138

I achieved this script. But the script took longer times to load

T:

LOAD * INLINE [

ID

325

43534

78204

A3C

] ;

LOAD ID , Concat(HID , '' , S) AS HID

Group BY ID;

LOAD ID , 3& Mid(ID , IterNo() ,1) AS HID , IterNo() AS S

Resident T While IterNo() <= Len(ID) ;

But this small piece of code took longer times.

So there any other way to achieve this with lower reload time.

1 Reply

Re: Adding one char (3) to to each char in a string

Well, you could try a mapping table and mapsubstring


talk is cheap, supply exceeds demand
Community Browser