问题
Within one of my Tableau reports, I have an Acquirer Reference Number field which is 23 digits long. When the data downloads into Excel, Excel truncates the column and shows it as scientific notation (shown below) instead of the full 23 digit number. I know this isn't a Tableau issue, but I was wondering if anybody has ran into this issue and what the workaround is.
I have tried to reformat this column in Excel after the data is downloaded, but it converts the last several digits to 0s.
I want the full Acquirer Reference Number to be displayed like this: 24692168345100558990040 instead of like this: 2.46921690161007E+22.
回答1:
It looks like there is a known 15 digit limitation due to the floating point numbering system used behind the scenes in Excel:
https://superuser.com/questions/373997/adding-more-than-15-digits-in-excel
(Take note that it appears that Tableau has the same 15 digit floating point limitation when it comes to measures and mathematical operations.)
I have reproduced your situation, and even when the Acquirer Reference Number is within Tableau as a Dimension and even when it is also converted to a 'String' type - it will still export to Excel in scientific notation.
The only workaround I've been able to find is to instead of "Exporting Data" to instead "Export Crosstab to Excel" as seen below in the "Worksheet" Menu. The result is similar to that of putting an apostrophe in front of every cell in the Excel workbook. It doesn't look as pretty, it has limitations, but it might accomplish what you are trying to do.
Edit for Tableau Server consideration:
Tableau Server seems to generate .csv files for both "Data" and "Crosstab" download options. This is contrasted by Tableau Desktop generating a .xlsx file for the "Crosstab" option. This could be a bug or a known limitation of Tableau Server creating .xlsx files.
As a workaround, since the Acquirer Reference Number is a most likely a dimension (ie: not having math performed on it,) a calculated field like this could be created and resulting string explained to users (or inherently understood by them):
"AR:" + STR([Acquirer Reference Number])
Turns 24692168345100558990040 into AR:24692168345100558990040
I have verified that the output looks okay in exporting from Tableau Server to Excel. The leading letter(s) cause Excel to recognize the field as text instead of a number.
来源:https://stackoverflow.com/questions/55360109/downloading-tableau-data-into-excel-scientific-notation-column