Differences between revisions 1 and 2
Revision 1 as of 2023-01-13 22:58:57
Size: 648
Comment:
Revision 2 as of 2023-01-13 23:00:06
Size: 654
Comment:
Deletions are marked like this. Additions are marked like this.
Line 33: Line 33:


SPSS Scratch Variables


Declaration

Scratch variables are declared like:

compute #TotalSales = sum(Sales, #TotalSales).

Note the names are prefixed with a hash (#). This is a requirement.


Usage

Scratch variables are firstly useful as temporary variables. They are deleted in the next execution (e.g. the next EXECUTE command).

Scratch variables are also useful for data aggregation, as they are not re-initialized for each case.

compute #TotalSales = sum(Sales, #TotalSales).
compute Total_Sales = #TotalSales.


CategoryRicottone

SPSS/ScratchVariables (last edited 2023-06-09 16:38:07 by DominicRicottone)