This article describes how to go from two or more tables...
...to an R table that switches between them based on a Control box selection:
Requirements
- Two or more tables. Here, we will use date-by-gender and age-by-gender tables.
- A Control box or an R-based Calculation that outputs the names of the tables. Here, we will use a combo box that includes the table names of Date and Age:
Method
1. Select your first table, for example, the age-by-gender table. Go to Table > Select in the toolbar. You can also manually select the table under Data > Table 1 > Tables in Page(s) in the object inspector, if you first create a table via Table > Select. Here, we will use our date-by-gender table.
2. OPTIONAL: Choose the appropriate Select rows/columns by option in Table 1. In this example, we will leave the default settings.
3. OPTIONAL: Select the rows and columns to display under Rows/columns to exclude in Table 1. Again, we will leave the default settings.
4. Select your second table under Data > Table 2 > Tables in Page(s). This will be our age-by-gender table.
5. Adjust the appropriate selection options as per steps 2 and 3. In this example, we will keep all the defaults for Select rows/columns by.
6. OPTIONAL: Add a third table under Data > Table 3 > Tables in Page(s) and repeat the above steps until you have included all tables.
7. Once you select more than one table, a Table Selection group will appear at the bottom of the object inspector.
8. Enter the name of the tables under Table names (default 1, 2, ...) to match the control box items, i.e. Date, Age
. The table names need to be separated by a comma. They must match the order specified in the control.
9. Select your control box under Toggle between tables using. The item names in the control should match Table names.
10. OPTIONAL: Update Properties > Appearance > Decimals and Number format as required.
Next
How to Select Specific Rows and Columns to Appear in a Table
How to Select Specific Rows and Columns to Appear in a Date/Time Table
How to Use a Control Box as an Input for Calculations