Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikUser12321
Contributor
Contributor

Exporting a large number to a csv file

Hello all,

I have a quick question regarding exporting large numbers to a csv file. I have several numbers that start with '0's and are up to 20 digits long. For example, the column IDs have numbers similar to - 00099123450025165297 

I am joining 2 tables and exporting the join of these tables to a csv file using the 'store' statement. When checking the exported csv file, the large numbers are being stored in exponential format like 1E+17, and when I click on the number they are in the following format - 99123450025165200. The initial '0's are being skipped and the last 2 digits are being rounded off. 

I researched a lot regarding this issue and saw several threads in which they tried to convert the numbers to text, use evaluate, num(num#) and other hardcoding methods, but nothing seems to be working here in my case. I am fairly new to Qlik and any help here will be greatly appreciated. 

Thanks in advance! 🙂 

Labels (3)
1 Reply
Or
MVP
MVP

I would suggest ensuring the longer field is loaded as a string / text to begin with, and applying text(Field) to it in the Qlik portion of the script as well to ensure it stays that way. This should keep it from trying to become a number which would indeed cause the issue you are describing.

e.g. in Oracle, you'd use

Load Text(Field) as Field;

SELECT TO_CHAR(Field) as Field

From SomeTable;

In SQL Server, probably:

Load Text(Field) as Field;

select convert(varchar,Field) as Field

From SomeTable;