When working with tables, you can use complex MATH formulas similar to the Excel principle. Although, instead of selecting cells, you select row or column labels.
How to use MATH
The DeX interface has a special window for entering formulas. Here we've added a prompting option for ease of use.
Click the MATH button to open the window
Select Row or Column where you want to add the calculation;
Press Ctrl+Space/Cmd+Space to activate prompts;
Enter an expression you need in the MATH window, using formulas and arithmetic operations;
Click the 'Add' button and get the result in a row/column.
In the prompts, the labels aka variables are marked with the 'x' symbol; the functions are marked with the 'f' symbol.
Syntax & Formulas Usage
A range of functions represent metrics that previously had to be deliberately added to a crosstab. Now you can get the value of a metric by a function, then apply a mathematical operation to it.
These metric functions are:
Syntax | Result |
MEAN ('variable label') | returns the mean value based on the digit value of the selected variable |
BASE ('variable label') Stat.Base UBASE ('variable label') Unweight.Base | returns the base value of the selected variable;
returns the statistical base value;
returns the unweighted base value for the selected variable;
returns the unweighted base value |
CNT ('variable label') | returns the count of the selected variable |
HPT ('variable label') | returns the horizontal percent of the selected variable |
VPT ('variable label') | returns the vertical percent of the selected variable |
VOL ('variable label') | returns the volume value of the selected variable |
Other functions give you the following values:
Syntax | Result |
ABS ('variable label') | returns the absolute value of the chosen variable or the expression |
AVG ('variable label') | returns the average value of the chosen variable or the expression |
AVG.INC ('variable label') | returns the average value of the chosen variable or the expression including SYSMIS |
AVG.EXC ('variable label') | returns the average value of the chosen variable or the expression excluding SYSMIS |
AVG.P ('variable label') | means AVG Post and returns the average value of the chosen variable or the expression after masking was applied |
Weight.Avg ('variable label') | returns the average value from a weighted base |
CELL ('variable label 1','variable label 2') | returns the value of a particular cell by specifying ‘column, row’ OR ‘row, column’ respectively, using commas |
COUNT | returns the number of rows or columns with variable values in the table; series with MATH or logical expressions are excluded from counting |
CORREL ('variable label 1', 'variable label 2') | returns the correlation coefficient of two variable’s ranges |
CUMULATE('variable label') | returns cumulative totals for rows/columns |
MAX ('variable label a', 'variable label b', ... 'variable label x') | returns the largest value in a set of values |
MAX.Label | returns the label of a largest value in a row/column |
MIN ('variable label a', 'variable label b', ... 'variable label x') | returns the smallest value in a set of values |
MEDIAN | returns the median value of all series |
RANK | returns the rank of a value in a row/column |
PERCENTRANK | returns the percentage rank of a value in a row/column |
ROUND ('variable label','decimal') | returns a value in a row/column rounded to a certain decimal point |
SUM ('variable label a', 'variable label b', ... 'variable label x') | returns the value of the sum of the given set of variables |