Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have text field (Kostenplaats) which in some cases contains leading zero. I wrap the field in TEXT() function and the Qlikview shows it correctly in Qlikview. However when I store the resident to CSV, Qlikview drops the leading zero and perceives the field as a number.
FOR EACH vBatch in $(vBatchList)
exportFactuurBatch:
Load
Datum,
TEXT(IF (labelId =1 , '08 ', '608')) AS Kostenplaats,
'D' AS Accounttype
resident Inputfile
WHERE Batch = '$(vBatch)'
;
LET vOutputFile = 'Webshopgiftcard Factuur Batch '& '$(vBatch)' & '.csv';
// store output file in intermidiate server location
store * fro
m exportFactuurBatch into [$(AfasOutputLocation)\$(vOutputFile)] (txt, delimiter is ';') ;
output:
This should be easy, right?
Dror
Did you open the csv file in Excel of in a text editor? If it's Excel it's possible Excel is interpreting the text as numbers and dropping the leading 0.
In both. Both are dropping the leading zero's
I can't reproduce this. The leading zero and the trailing space are preserved in the csv file here. Can you post an example file that reproduces the issue?
Hi,
I was just working on a similar issue. You might have found the way, but for people with similar issues.
Store CSV file using semicolon instead of colon
It is a feature of excel to trim the zeros when uploaded from a different source. Sadly we cannot change that feature.
But if one reads the same file again back into Qlik the preceeding Zero's come in.