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: 
kulasekhar
Creator
Creator

Leading zeros and spaces

Hi guys.

I need help on an issue. I have a view in sql server that brings two records 539681 17 and 0053968117.

These are two different items.When i  make a select from that view on a qvw the result is that it brings only one of the records.

I have tried Text(ITEM_NUMBER) but it didnt work. Can anyone help?

See below Database Tale:

ITEM_NUMBERBASELINECUT

0056729003,         TERMINATED

56729003SUB1,    IN_PRODUCTION

539681 17,           IN_PRODUCTION

0053968117,         TERMINATED

063230100511,      TERMINATED

63230100511,         IN_PRODUCTION

I want show  data same as database with leading zeros, spaces and any caraters(56729003SUB1).

Thanks

Sekhar

1 Solution

Accepted Solutions
avinashelite

Click on the Use advance editor > then to bottom right you will see the attach option


I feel while fetching from the DB itself it getting truncated

add the Text(ITEM_NUMBER) in the SQL query itself

View solution in original post

8 Replies
avinashelite

Did you tried the text(ITEM_NUMBER) in the script ??

kulasekhar
Creator
Creator
Author

Hi Avinash,

yes i had tried but it's not working mine.

Thanks

Sekhar

vishsaggi
Champion III
Champion III

When I run this i get all the values for ITEM_NUMBER in listbox check:

LOAD Text(ITEM_NUMBER) AS ITEMNUM,

     BASELINECUT;

LOAD * INLINE [

ITEM_NUMBER,  BASELINECUT

0056729003,         TERMINATED

56729003SUB1,    IN_PRODUCTION

539681 17,           IN_PRODUCTION

0053968117,         TERMINATED

063230100511,      TERMINATED

63230100511,         IN_PRODUCTION

];

Capture.PNG

kulasekhar
Creator
Creator
Author

Hi All,

How Can i add QVW this link.

Thanks

Kulasekhar

avinashelite

Click on the Use advance editor > then to bottom right you will see the attach option


I feel while fetching from the DB itself it getting truncated

add the Text(ITEM_NUMBER) in the SQL query itself

kulasekhar
Creator
Creator
Author

Hi All.

I have attached QVD and QVW below URL. Please help me.

Leading spaces and zeros

Thanks

Sekhar.

vishsaggi
Champion III
Champion III

As Avinash Suggested,

Did you try using Text(ITEM_NUMBER) in the script that generates this QVD.

and Sunny explained in this link you sent, that we cannot find the number 0053968117 in the QVD. Can you check that?


Can you send us the script that generated this QVD?

passionate
Specialist
Specialist

Hi Babu,

You can use replace(ltrim(replace(MyField,'0',' ')),' ','0') AS MyField

To trim leading zeros


Regards,

Pankaj