Recoding Variables
Overview
Rich Data Services provides the ability to recode data on the fly. There are two ways to do this, a simple recode, or a banded recode.
Simple Recode
A simple recode is a way to specify a one to one relationship between the old value and the new value. It would map one single value to a new value.
The syntax for a simple recode is newVar:originalVar[originalValue1=newValue1;originalValue2=newValue2;...]
http://{host}/rds/api/catalog/{collection}/{view}/select?cols=newVar:originalVar[0=1;1=2;2=3]
Banded Recode
A banded recode provides a way of recoding multiple values at once. In this case users will specify that a value range in the original variable should be recoded to a single value in the recoded variable.
The syntax for a banded recode is newVar:originalVar[start:end=newValue1;start:end=newValue2;...]. In addition, the value * can be used to specify a upper or lower limit.
http://{host}/rds/api/catalog/{collection}/{view}/select?cols=newVar:originalVar[*:10=1;11:20=2;21:*=3]