Restricting the variables in the export
Sometimes you may want to export a subset of the variables in your project. For example, you may want to export certain key variables only.
Filtering data in a DMS file describes how you can set up a metadata filter in your DMS files to restrict the variables included in the export. However, sometimes you may want to restrict an export to variables of one type, such as categorical or text variables. The UNICOM Intelligence Developer Documentation Library includes two sample .
mrs files that are useful when you want to do this. These samples could easily be amended to select variables of different types.
Both samples create a SELECT statement containing
Respondent.Serial and all of the variables of the specified type. You can easily copy the SELECT statement in the text file and paste it into your DMS file. It is also easy to delete the names of any variables of the specified type that you do not want to include. Alternatively, you can use the text file as an Include file. The
mrInterviewCategoricalsOnlyToDDF.dms sample provides an example of doing this. For more information, see
Sample DMS files for exporting UNICOM Intelligence Interviewer data. In addition, the
CategoricalsOnly.bat sample batch file provides an example of running the two files. For more information, see
Sample batch files.
ListCategoricalVars.mrs
This writes the full name of each categorical variable instance to a text file in a form that can be copied and pasted straight into the select query in a DataManagementScript (DMS) file.
ListOpenEndedVars.mrs
This writes the full name of each text variable instance to a text file in a form that can be copied and pasted straight into the select query in a DataManagementScript (DMS) file.
For more information, see
Sample mrScriptBasic files.
See also