Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Karim_Khan
Creator III
Creator III

Is this possible to store values with leading zero in csv and xls

Hi Team,

   I have tried every attempt to store the value with leading zeros in qlik view but all got wasted same is working fine in front end of qlik view.But while am trying to store it in .excel or .csv format it getting removed.If I will open the same with notepad its taking leading zero can somebody is it possible or shall i drop my hope and ?

PFB attempts have tried

1. Text((Repeat('0',5-len(EMP_NO))))AS EMP_NO,

2. if(LEN(EMP_NO)>3,TEXT((Repeat('0',5-len(EMP_NO))&EMP_NO))) AS NEW_NO,

3. replace(ltrim(replace(EMP_NO, '0', ' ')), ' ', 0) as NewMaterial,

4 . IF (LEN(TRIM(EMP_NO))= 5 , '0' & EMP_NO, EMP_NO) AS LEN_NBR,

Regards,

KK

New to QlikView

KK
1 Solution

Accepted Solutions
marcus_sommer
MVP & Luminary
MVP & Luminary

Extending the example from Felip I meant the following:

x:

Load chr(8203) & Data as Data Inline

[

Data

2

000001

];

store x into x.txt (txt);

- Marcus

View solution in original post

6 Replies
felipedl
Partner
Partner

Hi Karim,

This code:

x:

Load * Inline

[

Data

2

000001

];

store x into x.txt (txt);

Gets me the attached file.

Can you share what you're doing and some sample data?

marcus_sommer
MVP & Luminary
MVP & Luminary

It has nothing to do with Qlik else it's a special excel-feature demonstrating it's very high level intelligence to interpret the content - unfortunately it's not customizable or could be disabled (at least as I know).

As a workaround you could try it with a leading zero-white-space like chr(8203) or the excel own string-interpreter of chr(39) or something similar. By exporting objects from the gui to excel the chr(8203) worked well and I think the logic should work by storings, too.

- Marcus

Karim_Khan
Creator III
Creator III
Author

Hi Marcus Thanks for ur revert by exporting through GUI its working fine but how to interpret such things its challenge for me now

KK
marcus_sommer
MVP & Luminary
MVP & Luminary

Extending the example from Felip I meant the following:

x:

Load chr(8203) & Data as Data Inline

[

Data

2

000001

];

store x into x.txt (txt);

- Marcus

View solution in original post

Karim_Khan
Creator III
Creator III
Author

Thanks a lot man its done.....

KK
jenskrueger
Contributor III
Contributor III

Hallo Marcus,

und wieder einmal hattest du den entscheidenden Tipp: Chr(8203) vor die Nummer setzen bewirkt tatsächlich, dass in Excel die führende Null bestehen bleibt und kein Zeichen davor sichtbar / erkennbar / vorhanden ist. Genauso sollte es sein, super.

Danke dir.

Gruß,

Jens Krüger