Data-driven customization: transforming analysis variables
For categories/responses on row and column dimensions you may want to change the display of the results that come back. For example, you may wish to give clearer or more succinct labels, hide some extraneous (but analytically useful) categories such as ‘Don’t know’, change the order, or even sort by their values. Everything about the specific categories of rows and columns is specified in a block following its variable alias.
See Getting started with dashboard commands for more information.
Parameters for how data are computed
- SELECT <categories list> — For crosstabs involving a categorical array by another variable, indicates which categories (such as “Somewhat Approve”, “Strongly approve”) make up the numerator in the resulting crosstab, allowing you to effectively percentage the items along the "tabs" dimension with a base of all valid categories.
- ROLLUP <date unit> — For date/time variables, indicates the unit to ‘bin’ continuous time (days, months, and so on).
Labels, Colors, and Hide/Show Elements
Variables are always only referred to by alias. Labels of categories or items of arrays (subvariables) may be referred to by label, though the system will store them using category codes or subvariable aliases.
- TITLED <string title> — Change the heading for the variable, used to title the rows, columns, or axis where it is displayed.
- LABELS — Allows you to override the display name for each element in the dimension instead of its default label.
- COLORS — With a syntax similar to LABELS, this allows you to indicate the color to use to render each of the elements in the final render. Colors are specified as quoted 6-digit hexadecimal RGB ("663399"). There are no named colors and color triples are not prefixed.
- HIDE <elements list> — Indicates a list of elements for this dimension. You can indicate which ones not to include in the final rendering of the tile.
- SHOW ONLY <elements list> — Similar to HIDE, this permits you to indicate which are the only elements to be included. Show only is for scripters' convenience working with potentially long lists; when processed (or when you later inspect a tile definition) categories will be marked hidden, not "shown." (If a new category or item is later added to the variable, you would have to update the definition to hide the newcomer if desired.)
Subtotals
- INSERTIONS — Subtotals and differences are computed values, not inherent categories unto themselves. They are usually added to the underlying variable metadata (done by DP), but can be modified on a given tile, overriding the variable’s defaults. Typically users expect subtotals to be defined on variables and to INHERIT INSERTIONS on dashboards. This is the default behavior.
- COMING SOON — How to use anything other than inherit to redefine.
- To hide, rename, or otherwise refer to subtotals rather than categories, be sure to add SUBTOTALS before the relevant element labels (their codes exist but are not user-facing). For example, to color SUBTOTAL "Approve" (subtotaling somewhat/strongly approve), use COLOR SUBTOTAL "Approve" = "00ff00" to make it bright green.
- SORT — Allows a number of options to designate an order or instructions to sort dynamically. All except ‘sort elements’ may be ascending or descending. In addition, categories can be designated as ‘fixed’ at the bottom (useful for items like ‘none of the above’ that may otherwise be distracting). References to elements may be by code (category id or subvariable label) or label if enclosed in a double quotation mark.
- SORT ELEMENTS — Provide a specific order to display the categories by code or label. The mentioned elements will be displayed in this order, followed by any other valid, non-hidden ones.
- SORT BY LABEL — alphabetic sort by label.
- SORT BY MEASURE — ‘measure’ indicates a returned or calculated value in the result, such as count or percent.
- SORT BY ELEMENT — refers to an element of the opposing dimension. When placed on the rows dimension, this sorts rows by the column identified, and must include a measure by which to sort. You can also sort columns according to measures in a given row. To sort rows by the values of a column named, for example, "current customers", you would use 'sort by element "current customers" col percents'.
- SORT BY MARGIN — the "All" row or column is called the margin. To sort rows based on the marginal base, for example, you would use 'sort by margin unweighted row base'.
Available measures
- COUNT
- COUNT UNWEIGHTED
- COUNT WEIGHTED
- COL PERCENTS
- ROW PERCENTS
- TOTAL PERCENTS
- SMOOTHED COL PERCENT
- UNWEIGHTED COL BASE
- UNWEIGHTED ROW BASE
- UNWEIGHTED TOTAL BASE
- WEIGHTED COL BASE
- WEIGHTED ROW BASE
- WEIGHTED TOTAL BASE
- COLUMNS SHARE SUM
- ROWS SHARE SUM
- SMOOTHED MEAN
- STDDEV
- TOTAL SHARE SUM
- UNWEIGHTED VALID COUNT
- WEIGHTED VALID COUNT
- MEAN
- SUM
- COLUMNS MOE
- COLUMNS STD DEV
- COLUMNS STD ERR
- PAIRWISE T TEST
- ROWS MOE
- ROWS STD DEV
- ROWS STD ERR
- SMOOTHED COL INDEX
- TOTAL MOE
- TOTAL STD DEV
- TOTAL STD ERR
- Z SCORE
- COL INDEX
- P VALUE
- POPULATION
- POPULATION MOE
- BASE WEIGHTED
- BASE UNWEIGHTED
- PERCENTS
- PERCENT MOE
- PERCENT STDDEV
- PERCENT STDERR
- SHARE SUM