Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
richard_chilvers
Specialist
Specialist

Convert number to string


Hi

I am loading a table where a key field (for linking with other tables) may be just numeric or may be alphanumeric.

eg. 12345

or   1A345

As it is LOADed, the field is therefore interpreted as a number or a field.

I want to force the field to always be a string field, for convenience.

Please propose the best way of achieving this.

Thanks

Richard

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Use the Text() function.

     Load Text(FIeld) as New_Field

     From xyz;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

7 Replies
richard_chilvers
Specialist
Specialist
Author

Sorry .... please see correction below

As it is LOADed, the field is therefore interpreted as a number or a string.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Use the Text() function.

     Load Text(FIeld) as New_Field

     From xyz;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable

hi

Text(fieldname)   use for convert number into text

num(fieldname)  use for convert into number

MayilVahanan

Hi

Try with Text() function, resolve ur problem.

which convert num to string.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
richard_chilvers
Specialist
Specialist
Author

Thanks !

I guessed there would be an easy answer, but for some reason I thought the TEXT() function would fail on a string field

Not applicable

Thanks dude..this thread save me a lof of time..

Ken_Thomas
Former Employee
Former Employee

There is a knowledge article relate to this that is important to be aware of: 
Leading zeros are missing in loaded data values
https://qliksupport.force.com/articles/000003759

When leading zeros exist in the data load, the behavior can seem odd with leading zeros added sometimes and removed sometimes.  This article explains the behavior and gives a workaround if different behavior is needed.