Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

0 in front of data when loading from SQL

Hi,

I have a strange result when loading date from a SQL database into qlikview.

In my database i have a field containing numbers and letters. It's a nvarchar column. When i import the data in qlikview, qlikview is adding somethimes '0' to that column in front of my data.

codefam.png

Does anybody know how to resolve that problem?

Thank you

Michael

9 Replies
Anonymous
Not applicable
Author

Michael

Would formatting it with the num() function help ?

     = num ( '01' , '#0')

Bill

Not applicable
Author

Bill,

No because we have data that are 'L52' or 'P9999'

Michael

MayilVahanan

HI

Try like this

Load text(CODEFAM) as CODEFAM, LIBFAMFR, LIBFAMNL;

Sql Select * from Txt;

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

Your field CODEFAM is string field thats why you get 0 in front some values also this field has character and the numbers also so you are nor able to convert this into the number also. Try to make it text string like Text(CODEFAM).

Load

Text(CODEFAM) as CODEFAM

From Location;

Anonymous
Not applicable
Author

Michael

How about using the isnum() function ?

You can test by putting these expression in a text box :

     = if ( isnum( '01' ) , num ( '01' , '#0') , text ('01' ) )

     = if ( isnum( 'L52' ) , num ( 'L52' , '#0') , text ('L52' ) )

Not applicable
Author

I have tested by putting text but i have still the same problem

Code :

Load

Text(CODEFAM) as CODE,

LIBFAMFR as LIBFAM

RESIDENT TMP;

Not applicable
Author

It is working but it's not de result i want.

I have to keep some data like 01,02,03.....

Anonymous
Not applicable
Author

Michael

Can you identify which 01 's you want as 01 and which as just 1 ?

Not applicable
Author

Hi Bill,

No i can't.