If you use APP ENGINE to report the data from the temp table /staging table on to CSV file using excel format, there is a known issue with fields that have leading zeros. For ex:You have a field of length 6 characters. If the field value is 002123, the excel file removes the leading zeros. But if the requirement is to preserve those leading zeros, we can do something like this.
Update the temp table right before you write out into a file.
Basically , excel file can retain the leading zeros if the field is of the following format : "=Field"
Regards
Shiva
| Title | Under | Posted on |
|---|---|---|
| MD5 - SHA checksum of a file. | PeopleSoft Technical | 02/07/2012 - 5:29am |
| nVision Tabular Report through PIA with prompts | PeopleSoft Technical | 02/02/2012 - 10:07pm |
| Can we create an AE to mass update Position - Jobcode data? | PeopleSoft Technical | 01/18/2012 - 3:11am |
| Pay Components on job data can be defaulted and setup based on the rules? | PeopleSoft Functional | 01/05/2012 - 4:58am |
Comments
Hi Shiva,
As you specified an excel file can retain the leading zeros if the field is of the following format : "=Field", I tried to implement it in SQR and here is my code looks like:
begin-select
pw.mmc_kronos_payrule
'"='||pw.position_nbr||'"' &pw.position_nbr
and in the show statement I can see sth like "=00002345", but when I open a CSV file its truncating the leading zeros.
Please advise where I did wrong.
Thanks in advance,
Deepthi
Actually we also got the same problem when i loaded the data into csv file, as per the proprites of the csv it does not show the leading zeros, but when we copy it to other format or when we use that csv file for other purpose, it shows the actual number with zeros. we also tried with '=field name, but it shows leading zeros in the csv file,but when u copy this file into other format or when u use this csv for other purpose, u will get that value with concatination of '=field name.
Let $QUOTEEQUAL = '",="' !trick to prevent leading zero's getting dropped in Excel
It looks like you need a "," right before your "="
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Easy.
(but tricky, like all things microsoft...)
Before creating the csv file, insert an ASCII carriage return (NOT carriage return line feed or line fee) in front of the zero-starting string (say, a US East Coast Zip code like 08172) .
Enclose the whole thing in quotes, like you would a string with a comma in it
"[CR]08712"
(The [CR] represents whatever you have to input to the csv generating program to generate an ascii carriage return character)
XL does not recognize it has to do anything with the [CR] when it imports the csv automatically, but it treats whatever follows as a string, not a number.
Viola! (Tested up to XL XP only)
Hello!
I would need help displaying the leading zero values when importing csv files into excel WITHOUT having users formatting the cells/columns.
Thank you.
John
Hi
I tried "=00123" and ",=00123". Both didnt work.
Place the equal sig outside the quotes and it works ="00123"
Hi All,
I haved solved the problem by this way!
&DE = """" | Char(9) | """";
&Data_Str = &Data_Str | &DE | """" | "=" | """" | &EMPLID;
this works. i tried exporting to .txt and using the excel wizard but that's too much work for users. i also tried ="
this seems to be the best and easiest solution.
thanks.
Post new comment