VarValue Class (Python)
spss.CellText.VarValue(index,value). Used to specify
that a category or cell in a pivot table is to be treated as a variable
value. CellText.VarValue
objects honor display
settings for variable values in pivot tables (values, labels, or both).
The argument index is the index value of the variable. Index
values represent position in the active dataset, starting with 0 for
the first variable in file order. The argument value is a number
(for a numeric variable) or string (for a string variable) representing
the value of the CellText
object.
Example
from spss import CellText
table = spss.BasePivotTable("Table Title",
"OMS table subtype")
coldim=table.Append(spss.Dimension.Place.column,"coldim")
rowdim=table.Append(spss.Dimension.Place.row,"rowdim")
table.SetCategories(rowdim,[CellText.VarValue(0,1),CellText.VarValue(0,2)])
table.SetCategories(coldim,CellText.String("Column Heading"))
In this example, row categories are specified as the values 1 and 2 of the variable with index value 0 in the active dataset. Depending on the setting of pivot table labeling for variable values in labels, the values, value labels, or both will be displayed.