/
Computing Variables

Computing Variables

Overview

There are some cases when users may be interested in data that is held in the data source, but isn't readily available. A good example of this would be weighted values of a variable. In many studies there are weight variables that can be used to determine the weighted value of another variable. Users would need to multiply the weight variable against the variable that they are interested in to get the weighted value. Using the Rich Data Services users can do this on the fly. This allows users to skip the intermediate steps of computing these variables on their own and make it easier to develop against the data.

Supported Operations

Addition+
Subtraction-
Division/
Multiplication*
Absolute ValueABS()
CeilingCEILING(),CEIL()
FloorFLOOR()
Natural logarithmLN()
ModulusMOD()
PowerPOWER()
Square RootSQRT()

Computing New Variables

  • Variables can be computed using the following syntax in the cols parameter, variableName:computationExpression. The following will show you practical examples for a number of the supported operations described above.

    Addition
    http://{host}/rds/api/catalog/{collection}/{view}/select?cols=newVar:Var1+Var2


    Multiplication
    http://{host}/rds/api/catalog/{collection}/{view}/select?cols=newVar:Var1*Var2


    Square Root
    http://{host}/rds/api/catalog/{collection}/{view}/select?cols=newVar:SQRT(Var1)