Desktop User Guides > Professional > Table scripting > Table specification syntax > Base element > Excluding information from the base element
 
Excluding information from the base element
Sample script file: IncludeInBase.mrs
This example is based on the Museum sample data set. See Running the sample table scripts for information on running the example scripts.
You can exclude particular elements from the calculation of the base element, while still including the responses in rows or columns in the table. For category type elements, you can do this by setting the IncludeInBase element property of the element to False. This prevents the value for the category from being counted in the base, and automatically ensures that any summary statistics calculated from the base also exclude the category.
This script excludes responses of 'Other' from the calculation of the base count:
Table.Side.Museums.Elements["Other"].IncludeInBase = False
Alternatively, you can use the axis expression to achieve the same effect:
"museums{..Northern_Gallery, Other 'Other (excluded)' [IncludeInBase=False]}* gender"
The following table shows the results:
This graphic is described in the surrounding text.
Notes
Only the Count cell item is shown for excluded items, as it is not valid to calculate an element percentage on a base if that element is not included in the base.
Setting the IncludeInBase property to False automatically excludes the category from both base and unweighted base elements.
Items are excluded from the closest preceding base (or unweighted base) element.
The IncludeInBase property has no effect on 'built-in' base elements, for example, base elements in Quanvert datasets.
The property has no effect on elements other than base and unweighted base elements. It does not exclude the category from, for example, subtotals or totals. To exclude a category from a subtotal, place it after the subtotal.
If you set the IncludeInBase property to False in an element in a net, the element is excluded only from base elements within the same net.
The IncludeInBase property can be set to False only for category type elements.
Setting the IncludeInBase property to False overrides any expression specified on the base element.
If you want to exclude other types of element from the base, you need to create an expression to exclude it, using the Expression special element type. For an example of how to use the Expression special element type, see Special elements.
See also
Base element