Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
QV_learner
Contributor II
Contributor II

Leading zeroes get vanished

Hello Friends,

I am working on one application. In this, I extract data from SQL and store it into QVD. Now, I use this QVD to extract data into main application. But, when I load the data, for some values, the leading zeroes are vanished.

As a part of solution, I tried using text(); but this makes only few of the records to show leading zeroes and for rest of others, the leading zeroes are vanished.

Could you please help me understand this issue and resolve it?

Thank You!

Labels (1)
7 Replies
hectormunoz
Contributor III
Contributor III

Hi

if you know the lenght of the field you can use

text(num(field,'00000'))

 

so every value will have 5 positions

Regards 

QV_learner
Contributor II
Contributor II
Author

The field I am using has data type as 'Text'; sorry I didn't mention it earlier.

atoz1158
Creator II
Creator II

Hi

You could try using the following just adjust it for what you need

RIGHT('00000' & field,5)

So this will give

Field       Result

45            00045

0675       00675

HTH

Adrian

Vegar
MVP
MVP

It's probably enough to wrap text around the field when loading

 

Load

Text(FieldName) as FieldName

;

SQL SELECT

FieldName,

...

FROM DATABASE;

Brett_Bleess
Former Employee
Former Employee

Just to add to Vegar's post, the real question is whether the issue is in the backend in your DB, or on the ETL into QlikView?  Potentially, there may be something going on in the ODBC/OLE DB driver you are using to connect to the DB source as well, so if things are not making sense on our side, have a look on the DB vendor forums related to the Connector/Driver you are using etc. to see if you can find any known issues with it.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
QV_learner
Contributor II
Contributor II
Author

Thank you guys, for the answers.
I tried every one of them; but no luck.
Let me go with DB search option suggested by Brett, hope it will get some answer.

Once again, Thank You All!

 

Brett_Bleess
Former Employee
Former Employee

Hey Vivek, if you get further info, feel free to come back and post an update, and we can see if we can come up with anything else at that point...

Cheers,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.