VarName Class (Python)
spss.CellText.VarName(index). Used to specify that
a category or cell in a pivot table is to be treated as a variable
name. CellText.VarName
objects honor display
settings for variable names in pivot tables (names, labels, or both).
The argument 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.
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.VarName(0),CellText.VarName(1)])
table.SetCategories(coldim,CellText.String("Column Heading"))
In this example, row categories are specified as the names of the variables with index values 0 and 1 in the active dataset. Depending on the setting of pivot table labeling for variables in labels, the variable names, labels, or both will be displayed.