Professional > Table scripting > Table specification syntax > Base element > Working with built-in base elements
 
Working with built-in base elements
Sample script file: QuanvertTables.mrs
Sometimes variables (such as those in a Quanvert database) have base elements actually built into the variable. Built-in base elements sometimes contain filtering, which may, for example, exclude cases in a Don't know or Not answered category. When one of these bases appears in an axis, UNICOM Intelligence Professional does not add an autobase.
Note that when you use the element list syntax to specify which elements you want to include in an axis, you need to explicitly specify any built-in base elements if you want to include them. If you do not, UNICOM Intelligence Professional will automatically add an autobase to ensure that the axis has a base element.
For example, the Museum Quanvert sample database has a base element built into all of the categorical variables. In the following table, the side axis (which is based on the remember variable) will include the Quanvert base element, because it is explicitly specified in the element list, whereas the top axis (which is based on the gender variable) will not, because the built-in base element is not included in the element list. Therefore, UNICOM Intelligence Professional will create an autobase element for the top axis but not for the side axis.
TableDoc.Tables.AddNew("MyTable", "remember{Base, Dinosaurs, _
    Fossils} * gender{Male, Female}", _
    "Including and excluding the built-in base")
TableDoc.MyTable.Annotations[5].Specification = _
    "<B>Specification: </B><BR/>{TableSpec}"
Both of the base elements in the table have the default label of "Base" so the fact that one is an autobase and the other is the built-in Quanvert base is not immediately obvious simply from looking at the table. If necessary you can use the {TableSpec} annotation macro (see Annotation macros) to display the table specification as an annotation, as shown in the above example. Here is the table:
You can create built-in base elements in your variables in the Metadata section of a data management script (.dms) file. For more information, see Creating built-in base elements.
See also
Base element