User Guide
×
Menu
Index
 

Grid: Multiple Dynamic Columns

 
Creating a Grid with Dynamic Columns
 
This example uses the basic grid we created and adds dynamic columns to include data for different brands.
The contents of the dynamic rows (response labels and values) are tied to the column label.
 
 
 
Crosstab
 
For reference, this is the crosstab setup in Query:
 
 
Start by adding a grid to a new page. Grid Widget can be found under Advanced Visuals in the left ribbon.
 
Drag and drop the Grid Widget on the empty page.
 
Click the Edit on the new grid to get into Edit mode.
 
For this example, the “purchase reason” label will be added to the first column, and the “purchase reason” value (data) will be added to the second column.
The third column is not needed, so it needs to be deleted.
Click on the third column of the grid (Header 3).
 
In the bottom menu bar, click the grid icon with the red X, then select the Delete column option.
 
 
 
Defining the dynamic column and dynamic row expressions
 
As a reminder, a Dynamic Row is needed because we want to create a reference for the purchase reason listed in the first row and have the rows for all the remaining purchase reasons populate automatically (and dynamically).
 
 
Important: Ensure the grey bracket includes both columns before proceeding.
 
After selecting the bracket, it will turn blue and a menu bar will appear below the grid.
 
After turning on the Dynamic Column option, the bracket will turn red to indicate that the data range needs to be defined.
 
 
After switching on the Dynamic Column, click the Expression option (EXPR) in the menu bar.
 
Use the tabReference expression to create reference for the table.
 
Here are the steps to create a tabReference for our table:
 
1. Type in tabReference and open a bracket;
2. Type in @ and select the tab where you have your purchase reasons analysis.
3. Then add:
Since *All was selected for the Make of new car question, all makes are listed in the table.
 
Note: If all Purchase Reasons were shown instead of makes in this table preview, it most likely would be caused by the *All selection being used on the Purchase Reason question instead of the makes question. The tabReference would need to be revised and corrected.
 
 
As the tabReference syntax is shown as correct with a green check mark, you can click the OK button.
 
 
We will use an expression to fill the column cells with vehicle make labels later. The next steps will be creating additional expressions to define the Dependent Rows. Dependent Rows are needed because we want to create references for the purchase reasons listed in the rows that are associated only with the specific vehicle make shown in the column headers.
 
 
 
A Dynamic Row is needed because we want to create a reference for the purchase reason listed in the first row and have the rows for all the remaining purchase reasons populate automatically (and dynamically).
 
 
Turning on the Dynamic Row option will make the bracket red. This indicates that the data range for the Dynamic Row will need to be defined.
 
After turning on the Dynamic Row, click the Expression option (EXPR) in the menu bar.
 
The expression editor window will appear.
Use the tabReference expression to create reference for the table.
 
Here are the steps to create a tabReference:
 
1. Type in tabReference and open a bracket;
2. Type in @ and select the tab where you have your purchase reasons analysis;
3. Then add:
 
 
The bracket on the left border that was previously red is now blue. The data reference for the Dynamic Rows was created successfully.
The next step is to create additional expressions to fill the cells with some content.
 
As a reminder, the setting for the dependent rows option was previously turned on. This means that the contents in the dynamic rows are now connected to the dynamic columns. For this example, we used colProperty expression, which allows retrieval of any property (i.e. id, label or value) from a given column within the dynamic entity. The id option looks up the reference and creates associations by matching codes that are used internally. The id option should be used when working with data references and questions from the same dataset and/or study family.
 
When working with data references and questions from different datasets and/or different study families, it is recommended to use the label instead.
Internal codes can vary between study families, so in this scenario codes are not the ideal criteria to create matches on. The label option ignores the internal coding and uses the actual response label text to create matches.
 
Important: When you use a dynamic row or column, it only affects the Grid structure by adding rows or columns, not the content within the Grid. The data from this Table is available for you to use in the Grid, but it's up to you to decide which data to include in the final report and how to present it.
 
 
Adding data to your grid structure
 
 
 
 
 
 
The format of the row value will now be shown as a percentage.
 
Adjusting header of the Grid
 
 
 
 
 
Alpina should be visible in the header:
 
 
Click Close to exit Edit Mode.
 
 
This is what the newly created Grid will look like:
 
 
Recall the initial steps for creating this Grid.
In the Dynamic Column menu bar, we changed the Compare drop-down box from 10 to 5.
10 is the default number of columns to include across the grid.
We changed it to 5, so that is the reason why we have 5 columns in the Grid now.
 
Further Grid formatting
 
The following steps include additional formatting changes to the Grid Widget.
Select Grid and click Edit to return to Edit Mode to change the percentages to bars.
 
 
 
 
 
 
To format the range of the bars, click the Range option, located to the right of expression editor (EXPR).
The minimum and maximum values can be changed, along with the base (value at which the bar will begin plotting).
 
 
 
After completing the bar format changes, click the Close tab, at the top of the Grid, to exit Edit Mode.
 
This is an example of a Grid with bars.
 
 
Format the column headers
 
Select Grid and click the Edit tab to get back into Edit Mode.
 
 
 
Interactive Mode options
 
Filtering Sample Total
 
 
While in Interactive Mode, scroll down to view the complete list of purchase reasons per make.
Notice at the end of each list, there is a bar for Sample Total that shows 100%.
Ideally, this Sample Total entry should be hidden or not included in the Grid.
The following steps illustrate how to filter the Sample Total entry from the Grid results.
 
First, exit out of Interactive Mode by clicking the Design Mode tab.
Select the Grid in Design Mode, then click the Edit tab located at the top of the Grid.
 
 
 
 
 
Sorting Grid Results
 
When the results of the Grid are long and require scrolling, it might be preferred to display the results sorted by the top 10 highest, instead having to scroll through a long, unsorted list.
 
 
 
 
The existing expression will be modified to include sorting.
Before “(tabReference”  type the following: “(head(sort”
Conversely, if we wanted to show the entries at the bottom of the list, we would use “tail” instead of “head.”
 
 
 
 
 
 
 
 
This is an example of the Top 10 sorted Grid.
The results are easier to read and the layout is more user-friendly.
 
 
Widening the Rows
 
As a final formatting step, the width of the rows can be widened, so the response text is not truncated.
 
 
 
 
The response labels are displayed without being truncated.
 
 
To select a different make for a particular column, confirm the page is in Interactive Mode, then click the down arrow to display the menu for the available column options.