Versions Compared

Key

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

...

Variable Names

The first way RDS allows users to select variables is through the well known and traditional way of specifying variable names. If we know the variables we want to work with this is a great way to quickly subset our data. This is done through the use of the cols parameter, which takes a comma separated list of values.

Code Block
titleSubsetting by Variable Names
http://{host}/rds/{collection}/{view}/select?cols=col1,col2,col3,... 

Regular Expression

User can also use regular expressions to select variables. Regular expressions can be used on views that have minimal metadata. Again we will use the cols parameter for this, but rather than specifying a specific name we will use a regular expression. Multiple regular expressions can be passed in using the same comma separated list of values if desired. Users can also combine regular expressions with specific variable names.

Code Block
titleSubsetting by Regular Expression
http://{host}/rds/{collection}/{view}/select?cols={regex}

Keyword

Key words are another way to search for variables. When selecting variables by keywords it is important to have good metadata backing the variables. A variables name, label, description, and question text will be searched for the keyword and any and all matches will be returned. To search on keywords we will have to put a $ before the keyword we would like to search on in the cols parameter.

Code Block
titleSubsetting by Keyword
http://{host}/rds/{collection}/{view}/select?cols=$keyword 

Combination

All of the previously discussed techniques can be used at the same time if desired.

Code Block
titleSubsetting by Keyword
http://{host}/rds/{collection}/{view}/select?cols=col1,col2,col3,{regex},$keyword