Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Do More with Qlik - for Beginners and Beyond, Topic: Qlik Replicate on January 21, 2PM EST. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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

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

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

Creator
Creator

Hi Avinash,

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

Thanks

Sekhar

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

Creator
Creator

Hi All,

How Can i add QVW this link.

Thanks

Kulasekhar

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

Creator
Creator

Hi All.

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

Leading spaces and zeros

Thanks

Sekhar.

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?

Specialist
Specialist

Hi Babu,

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

To trim leading zeros


Regards,

Pankaj