Creating crosstabs with grid-type variable sets can make tables become very wide and difficult to read. An alternative way to look at grid-type variable sets in crosstabs is to flatten them. This process will treat the column headings as spans in the rows of your table, effectively turning a "wide" table into a "long" one.
There are two ways to achieve this in Displayr:
Method 1 - Check a setting in the variable set's object inspector
Method 2 - Create a new version that has a Multi Structure
As an example, consider a table created from a grid-type variable set (in this case, a Nominal-Multi) crossed with a Nominal variable set. The example shows a grid consisting of brands and respondents' preferences for those brands, crossed with a gender variable.
We'll go from the above table format to a table that makes it a "long" table instead of a "wide" one, like this:
Requirements
- A variable set with a grid-type structure where there are both rows and columns for the variable set in a summary table. Grid-type variable sets include those with a Structure of:
- Nominal-Multi
- Ordinal-Multi
- Binary-Grid
- Numeric-Grid
Method 1 - Check a setting in the variable set's object inspector
Note this method is automatically applied on grid-type variable sets created after April 2025. To not automatically flatten the variable set in crosstabs, you will uncheck this setting.
- Select the grid-type variable set under Data Sources.
- In the object inspector under Data > Properties, check the box labeled Structure as Binary-Multi in crosstabs (or Structure as Numeric-Multi in crosstabs for Numeric variable sets).
- Now you can create your crosstab. Drag your variable set onto the Page (or into the Report tree) to create a table.
- Add another variable set to the object inspector > Columns of your table to create a crosstab. Notice the original columns in the table are now unnested into the rows of the table.
Method 2 - Create a new version that has a Multi Structure
This method will generate a new variable set under Data Sources, which will convert a Grid-type variable set to a Binary - Multi variable set. When tabulated, it will go from a Grid, like this:
To a single column of data, like this:
- Under Data Sources, select the Grid-type variable set you want to convert.
- Click + > Convert To > Binary/Multi > Flatten Nominal/Ordinal Multi (previously called Flatten Variable Set(s)).
This will create a new variable set in the Data Sources tree, which, when used in a table, will give the "long" version above.
Note that this is the same as the function Anything (+) > Data > Variables > New > Convert To > Binary/Multi > Flatten Nominal/Ordinal Multi.