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: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Export a table with numbers starting by 0 to excel.

Hey guys!

I want to ask a question. There's any way to keep the first 0 of a number when you export it to an excel page?

Let me show an example of zip codes :

load * inline [

zip code, city, country

01010 , Barcelona, Spain

08032, Madrid , Spain

];

When this data is charged in the QV, and I want to export it to an excel sheet, the result is :

zip code city country

1010 Barcelona Spain

8032 Madrid Spain

Obviously, is wrong, there is a 0 left because excel formats automatically the number.

Is there some way to avoid this and keep the first 0 ?

Many thanks in advance!

1 Solution

Accepted Solutions
hector
Specialist
Specialist

Hi, did you try text() function?? something like

text(zipcode) as zipcode_text


or another solution is concatenate the character ', so this will be

Chr(39) & ZIPCODE as ZIPCODE_TEXT


rgds

View solution in original post

2 Replies
hector
Specialist
Specialist

Hi, did you try text() function?? something like

text(zipcode) as zipcode_text


or another solution is concatenate the character ', so this will be

Chr(39) & ZIPCODE as ZIPCODE_TEXT


rgds

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Thanks Hector, that was the secret.

If you want to export as a text, you have to use first the text() function. That's simple.

THank you very much.