Column Subtotals

These IronPython scripts below show how to modify any of the Cross Table visualization settings found on the Column Subtotals tab of the Cross Table Properties dialog box in the Spotfire user interface.

In each of the scripts below, it is assumed that the MyVis variable references the targeted visualization. See here for more information about referencing visualizations.

Show Subtotals for Specific Columns, Before or After Values

The IronPython script below shows how to change any of the options on the Column Subtotals tab of the cross table Properties dialog box.

from Spotfire.Dxp.Application.Visuals import *

myVis = myVis.As[Visualization]()

# Show all column subtotals

# Show no column subtotals

#Show only specific column subtotals
myVis.ColumnSubtotals["Column 1"].Visible = True
myVis.ColumnSubtotals["Column 2"].Visible = False

# Display subtotals before values:
myVis.ColumnSubtotalsLayout = CrossTableSubtotalsLayout.Before
# OR
# Display subtotals after values:
myVis.ColumnSubtotalsLayout = CrossTableSubtotalsLayout.After

The purpose of this website is to provide a comprehensive, accurate, and efficient IronPython reference for Spotfire developers.