Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

While a A simple recode may suffice in some circumstances, at other times users may like to recode a large group of values into smaller groups. The banded recode allows users to specify ranges of values to recode into new values. 

Banded Recode

A banded recode provides a way of recoding multiple values at onece. 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. 

Step By Step

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;...]

Code Block
titleSimple Recode
 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.

...

Code Block
titleBanded Recode
http://{host}/rds/api/catalog/{collection}/{view}/select?cols=newVar:originalVar[*:10=1;11:20=2;21:*=3]