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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
DipeshVadgama
Partner - Creator II
Partner - Creator II

Add text before Number ??

Hi All,

I am using Qlik Sense 1st time. I am trying to add text before number, which is not working.

I did tried Dual & right (Field -1) or

Text & right (Field -1). But I am getting out put as "-".

field1

T1000

T2000

T3000

T4000

I want output as Field2

T999

T1999

T2999

T3999

.......

5 Replies
shraddha_g
Partner - Master III
Partner - Master III

try

Text(left(Field,1))&text(right(Field,len(Field)-index(Field,'T',1))-1)

mdmukramali
Specialist III
Specialist III

Dear Dipesh,

you can use string functions.

LOAD *,

Left(field1,1)&''&(Mid(field1,2)-1) as field2

Inline

[

field1

T1000

T2000

T3000

T4000

]

;

jonathandienst
Partner - Champion III
Partner - Champion III

Something like (this will preserve the first character

Left(field1, 1) & (Num(KeepChar(field1, '0123456789')) - 1)

or

Left(field1, 1) & (Num(Mid(field1, 2, len(field1))) - 1)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
its_anandrjs
Champion III
Champion III

Try this also

LOAD *,

left(field1,1)&Text(right(field1,4)-1) as Newfield1;

LOAD * INLINE [

    field1

    T1000

    T2000

    T3000

    T4000

];


NewFields.PNG

Regards

Anand

DipeshVadgama
Partner - Creator II
Partner - Creator II
Author

This work perfectly, Thanks