How to Set Decimal Output of table function SPSS

Output report has been formattedt for 2 decimal points, but when I export into Word, all decimal values are shown.  How can we set the output value to two decimal points only?  We have formatted reporting for a client for high volumes of such data and manually adjusting in Word is killing us.
Who is Participating?
richdiesalConnect With a Mentor ProfessorCommented:
Oh, you want to do this in syntax.  That's different, but the answer is no better.

When you compel the data to PCT7.2, you're really changing one thing: the displayed format of the data in your table/output.  The data is still exactly as it originally was entered - it is never changed.  Thus when it appears in your output table, even if you are compelling it to appear in the output table with 2 decimal points, it still contains all that data with full decimal places.

There is no way in standard SPSS syntax to compel the data to be copied out of a table any other way.  Your only option, if you still want to use SPSS, is to use the Python scripting language add-on to script data exports in the format you want (problems like yours are exactly the reason Python was integrated into SPSS).

Personally, if you're going to learn a programming language for statistics anyway, I would just switch to R, which has much better control over data and how it appears than SPSS+Python ever will.
SPSS is unfortunately absolutely terrible at output formatting.  My workaround is usually to copy to Excel first, do formatting in Excel, and then copy from Excel to Word.

But if you still want to do it in SPSS itself, you'll need to:
1) In the output pane, double-click on the table you want to format to open Table Edit mode.
2) Select the cells you want to format.
3) Right-click and select Cell Properties.
4) Open the Format Value tab.
5) Select Number category with 2 decimal places and hit OK.

Note that without a strong processor, SPSS will likely grind to a halt when you try to select a lot of cells at the same time (an unfortunate side-effect of the transition of the software to Java).
manager562Author Commented:
Hi richdiesal
  /FTOTAL $t 'N'
  ( import1 ) BY
  (LABELS) > (STATISTICS) + $t by var00001
  /STATISTICS COUNT ((F5.0) 'Count' )
    CPCT ((PCT7.2) '%' :VAR00001)  /TITLE  'import1'.
I can format displaying of the percentage using PCT7.2. Is there any function or sub function to change the value with 2 decimal point? All the process should be automatic.
manager562Author Commented:
Thank you for your time. At least I don't vast may time looking for solution.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.