Functions for Deriving Datasets
There are many functions available for calculating new datasets. You
can type them directly (in ALL CAPS for those that include words or abbreviated
words), or add them to your dataset definition using the pull-down menu.
Click on the functions below for more information about each one.
+add
-subtract
*multiply
/divide
^raised
to the power.
For example 2^2 is 2 squared (2 * 2 = 4).
=is equal
to. This is used for comparing two values, not for resetting a value to
another.
For example, IF($("X")=5, "is
five", "is not five") evaluates whether dataset "X"
has the value 5 at a given location. If the statement shown here
is true, the new dataset holds the value "is five", while locations
where this statement is false will have "is not five" as an
attribute value in the new dataset.
!=is not
equal to. This is used for comparing two values, not for resetting a value
to another.
For example, IF($("X")!=5, "is
not five", "is five") evaluates whether dataset "X"
has a value that is not equal to 5 at a given location. The new
dataset holds the value "is not five" if the statement is true,
and "is not five" if it is false.
ORlogical
"or", which can be used inside other expressions. An expression
including "or" is evaluated as true if either part is true.
ANDlogical
"and", which can be used inside other expressions. The expression
including "and" is true if both parts are true.
<is less
than. This is used for comparing two values, not for resetting a value
below another. For example, IF($("X")<5,
"is less than five", "is not less than five") evaluates
whether dataset "X" has a value less than or equal to 5 at that
location, and the new dataset holds the value "is less than five"
if it does (the statement is true); otherwise the attribute will be "is
not less than 5."
<=is less
than or equal to. This is used for comparing two values, not for resetting
a value below another. For example, IF($("X")<=5,
"is less than or equal to five", "is not less than or equal
to five") evaluates whether dataset "X" has a value less
than or equal to 5. The new dataset holds the value "is less
than or equal to five" if it does, and "is not less than or
equal to five" if the statement is false.
>is greater
than. This is used for comparing two values, not for resetting a value
below another. For example, IF($("X")>5,
"is greater than five", "is not greater than five")
evaluates whether dataset "X" has a value greater than 5 at
that location, and the new dataset holds the value "is greater than
five" if it does (the statement is true); otherwise the attribute
will be "is not greater than 5."
>=is greater
than or equal to. This is used for comparing two values, not for resetting
a value below another.
For example, IF($("X")>=5, "is
greater than or equal to five", "is less than five") evaluates
whether dataset "X" has a value greater than or equal to 5,
and the new dataset holds the value first statement if it does, and the
second if it does not.
ABS(expr)absolute
value of a dataset or expression.
For example, the absolute value of a data value of "-5" is "5".
COS(expr)cosine
of data value or expression
DECIMAL(expr)This function
turns the argument into a decimal value. If you have a string dataset
that holds digits, using DECIMAL("string
dataset name here") would convert those text numbers into numeric
numbers.
This is the complement of the function string.
EXP(expr)This is
the exponential function. It raises e
to the specified argument.
IF(condition, then expr,
else expr)If the
condition is true, say RWM > 1.5, then it returns the "then expression",
if it isn't true it returns the "else expression"). For the
"then, else" statements, the new variable can be either a string
or numeric, but they have to match. For string expressions, put the expression
into quotation marks (e.g. "yes"). For numeric, you can simply
type the number.
Examples: IF($("RWM")>1.5, "greater
than 1.5", "less than 1.5") or IF($("RWM")>1.5,
0, 1)
For more than two groups, use nested IF statements.
Example: IF($("RWM")>1.5, "high" (IF($("RWM")>1,
"medium", "low")))
INTEGER(expr)This function
turns the argument into an integer.
If you have a string dataset that holds digits, using INTEGER("string
dataset name here") would convert those text numbers into integers.
For example a string data value of 1.8 would be a 1 in the new dataset.
This is the complement of the function string.
It can be used to truncate decimal datasets to integers.
ISMISSING()ISMISSING(expr)
will be evaluated as "true" if the argument is missing. For
example, "IF ( ISMISSING( $("X") ), 0, 1) will assign any
location where the dataset "X" is missing a value of "0"
and will assign "1" to the other locations.
LOG(expr)The natural
log. The new dataset is the natural log of the original dataset's values.
LOG10(expr)The base-10
log. The new dataset is the base-10 log of the original dataset's values.
MAX($("Dataset"))maximum
of a dataset over all times. This is a single value for an entire geography,
calculated over all times and all objects.
MAX($("Dataset"), y, m, d, h, m, s)maximum
of a dataset at a particular time. This is a single value for an entire
geography, calculated at the specified time. If the data has only dates
or only time, you only need to specify the appropriate time stamp information.
MEAN($("Dataset"))mean of
a dataset across all times. This is a single value for an entire geography,
calculated over all times and all objects.
MEAN($("Dataset"), y, m, d, h, m, s)mean of
a dataset at a particular time stamp. This is a single value for an entire
geography, calculated at the specified time. If the data has only dates
or only time, you only need to specify the appropriate time stamp information.
MIN($("Dataset"))minimum
of a dataset across all times. This is a single value for an entire geography,
calculated over all times and all objects.
MIN($("Dataset"), y, m, d, h, m, s)minimum
of a dataset at a particular time stamp. This is a single value for an
entire geography, calculated at the specified time. If the data has only
dates or only time, you only need to specify the appropriate time stamp
information.
MISSING()Creates
a new dataset of missing values or it can be used in an IF statement to
make the resulting value missing. MISSING() would create a missing value,
which you could use in an "IF" statement to avoid division by
zero, as in this example:
IF($("POP")=0, MISSING(), $("COUNT")/$("POP"))
MOD(expr)Modulus, or remainder (also often written as %).
This operator divides the values in your data set by the expression
you choose, and returns the remainder. For example, 10 MOD(3) =
1.
OBJID()Returns
the id of the current location being evaluated. For instance, if you want
to eliminate the first 100 values of a dataset, "X", from analysis
you could create a new dataset with the expresion: IF(OBJID()<100,
MISSING(), $("X"))
SIN(expr)sine of
data value or expression.
SQRT(expr)square
root of data value or expression.
STDDEV($("Dataset"))standard
deviation of dataset. This is a single value for an entire geography,
calculated over all times and all objects.
STDDEV($("Dataset") , y, m, d, h,
m, s)standard deviation of a dataset at a particular
time stamp. This is a single value for an entire geography, calculated
at the specified time. If the data has only dates or only time, you only
need to specify the appropriate time stamp information.
STRING(expr,
width)create a new string variable of the expression
with a specified number of characters (width).
SUM(expr, expr,
...)sum of data values or expressions.
TAN(expr)tangent
of data value or expression.