Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
perumal_41
Partner - Specialist II
Partner - Specialist II

Problem

Hi ,

I have problem table  extacting from DB to Qlikview.

DB : table look like below

A,B

3,0701

65,701

Qlikview : table look like below

A,B

3,0701

65,0701

but when  where A=65  included this time geting correct output,: table look like below

A,B

65,701

plase advice me ,how can i solve this problem

Regards,

Perumal

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Qlikview uses the first record read to determine the format for the field. This field is being read as numeric, and because the first record has a leading 0, QV assumes format 0000 for the field. So the second record is read as 0701 (which is the number 701, displayed as 0701. So the numeric values are the same.

To prevent this, you can force the reading as text by:

LOAD A,

     Text(B) As B,

....

The text values '0701' and '701' are different.

HTH

Jonathan

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

View solution in original post

4 Replies
muniyandi
Creator III
Creator III

Use Num() funtion .

num(B)

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Qlikview uses the first record read to determine the format for the field. This field is being read as numeric, and because the first record has a leading 0, QV assumes format 0000 for the field. So the second record is read as 0701 (which is the number 701, displayed as 0701. So the numeric values are the same.

To prevent this, you can force the reading as text by:

LOAD A,

     Text(B) As B,

....

The text values '0701' and '701' are different.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jagan
Luminary Alumni
Luminary Alumni

Hi Perumal,

If you want initial 0s to be removed before the number then use Num() in script like below

Load A,

Num(B) AS B Inline [

A,B

3,0701

65,701

];

If you want initial 0s  to be retained to all the records then use Text() in script like below

Load A,

Text(B) AS B Inline [

A,B

3,0701

65,701

];

Regards,

Jagan.

perumal_41
Partner - Specialist II
Partner - Specialist II
Author

Hi

Thank for quick response to all.

I given sample as inline table .but real scenario i extract from DB2.

layer 1; i am using select * table.

so data store into QVD look like below

A,B

3,0701

65,0701.

if use text function  in  layer 2 or Preceding Load ,same output only coming.

in database field type is varchar.

B colum contains text and numeric value

please advice me.