Desktop User Guides > Professional > Table scripting > Hierarchical data > Which view of the data is used? > Using the flat view
Using the flat view
UNICOM Intelligence Professional automatically uses the flat view when the CDSC you are using to access the case data does not support the hierarchical view and no metadata is available.
When the flat view is being used:
You cannot create grid tables or use the variables that are nested inside a loop or grid in your tables. However, you can use a slice of a grid or loop in a table.
There is only one level, and so you do not need to choose the level at which your tables are to be populated.
The Table Object Model can handle both views of the case data. When you load a data set using a CDSC that supports the HDATA view, the Table Object Model automatically uses the HDATA view and when you load a data set using a CDSC that does not support HDATA, it automatically uses the flat VDATA view.
Provided the CDSC supports both views of the data, you can change the view using the DataSet.View property. You must do this at the beginning of your script, before you start defining your tables, axes, filters, and cell contents.
For example, by default the HDATA view is used for XML data sets. However, you could change this to the VDATA view as follows:
' Load the Museum sample XML data set
TableDoc.DataSet.Load("[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\ Data\XML\museum.mdd", _
, "[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\ Data\XML\museum.xml", _
"mrXmlDsc")TableDoc.DataSet.View = 0 ' 0 = dvVdata = VDATA view
To return to the HDATA view:
TableDoc.DataSet.View = 1 ' 1 = dvHdata = HDATA view
However, it is generally preferable to use the HDATA view, if possible, because it enables you to create grid tables and provides better support for tabulating data collected using loops.
See also
Which view of the data is used?